-
Notifications
You must be signed in to change notification settings - Fork 4
44 lines (40 loc) · 1.16 KB
/
delete-artifacts-of-workflow.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Delete artifacts of workflow run
on:
workflow_dispatch:
inputs:
pr-number:
description: 'Simulate a PR number, to use in content of the temp artifacts'
required: true
default: '648'
jobs:
create_artifacts:
runs-on: ${{ vars.RUNNER_UBUNTU }}
steps:
- name: Build fake artifact
env:
PR_NUMBER: ${{ inputs.pr-number }}
run: |
mkdir site
echo "This is a preview site for <b>PR #${PR_NUMBER}</b>" > site/file1.html
echo "This is a another preview site for <b>PR #${PR_NUMBER}</b>" > site/file2.html
- uses: actions/upload-artifact@v4
with:
name: artifact-1
path: site/file1.html
if-no-files-found: error
- uses: actions/upload-artifact@v4
with:
name: artifact-2
path: site/file2.html
if-no-files-found: error
delete:
runs-on: ${{ vars.RUNNER_UBUNTU }}
needs: create_artifacts
permissions:
# to delete artifacts
actions: write
steps:
- uses: geekyeggo/delete-artifact@v5
name: Clean up temp stored artifacts
with:
name: '*'