-
Notifications
You must be signed in to change notification settings - Fork 10
74 lines (70 loc) · 2.74 KB
/
test-workflow-with-action-upload-v3.yaml
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Test Workflow with our Action and Upload Artifact v3
on:
workflow_dispatch:
pull_request:
push:
jobs:
run-local-action:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Store Workflow
uses: actions/upload-artifact@v3
with:
name: "test-workflow"
path: ".github/workflows/test-workflow-with-action-upload-v3.yaml"
retention-days: 3
- uses: "./"
name: "Check artifact exists"
id: "check_workflow_exists"
with:
name: "test-workflow"
- uses: "./"
name: "Check artifact does not exist"
id: "check_non_existing"
with:
name: "non-existing-artifact"
- name: "Echo if artifact check_workflow_exists exists"
run: echo "::notice::Artifact in-deed exists."
if: "${{ steps.check_workflow_exists.outputs.exists == 'true' }}"
- name: "Echo if artifact check_non_existing does not exist"
run: echo "::notice::Artifact in-deed does not exist."
if: "${{ steps.check_non_existing.outputs.exists == 'false' }}"
- name: "Fail if artifact check_workflow_exists does not exists"
run: exit 1
if: "${{ steps.check_workflow_exists.outputs.exists == 'false' }}"
- name: "Fail if artifact check_non_existing does exist"
run: exit 1
if: "${{ steps.check_non_existing.outputs.exists == 'true' }}"
run-v0-action:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Store Workflow
uses: actions/upload-artifact@v3
with:
name: "test-workflow"
path: ".github/workflows/test-workflow-with-action-upload-v3.yaml"
retention-days: 3
- uses: xSAVIKx/artifact-exists-action@v0
name: "Check artifact exists"
id: "check_workflow_exists"
with:
name: "test-workflow"
- uses: xSAVIKx/artifact-exists-action@v0
name: "Check artifact does not exist"
id: "check_non_existing"
with:
name: "non-existing-artifact"
- name: "Echo if artifact check_workflow_exists exists"
run: echo "::notice::Artifact in-deed exists."
if: "${{ steps.check_workflow_exists.outputs.exists == 'true' }}"
- name: "Echo if artifact check_non_existing does not exist"
run: echo "::notice::Artifact in-deed does not exist."
if: "${{ steps.check_non_existing.outputs.exists == 'false' }}"
- name: "Fail if artifact check_workflow_exists does not exists"
run: exit 1
if: "${{ steps.check_workflow_exists.outputs.exists == 'false' }}"
- name: "Fail if artifact check_non_existing does exist"
run: exit 1
if: "${{ steps.check_non_existing.outputs.exists == 'true' }}"