-
Notifications
You must be signed in to change notification settings - Fork 102
60 lines (57 loc) · 1.89 KB
/
workflow-tester41.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Test 41 # Related to https://stackoverflow.com/questions/72704563/github-action-echo-within-an-expression
on:
workflow_dispatch:
jobs:
changes:
name: Detect changes
runs-on: ubuntu-latest
outputs:
# aws: ${{ steps.filter.outputs.aws }}
# azure: ${{ steps.filter.outputs.azure }}
# gcp: ${{ steps.filter.outputs.gcp }}
aws: 'true'
azure: 'true'
gcp: 'true'
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Check for changes
uses: dorny/paths-filter@v2
id: filter
with:
filters: |
aws:
- added|modified: 'aws/**'
azure:
- added|modified: 'azure/**'
gcp:
- added|modified: 'gcp/**'
zip_files:
runs-on: ubuntu-latest
needs: [ changes]
if: ${{ (needs.changes.outputs.aws == 'true') || (needs.changes.outputs.azure == 'true') || (needs.changes.outputs.gcp == 'true') }}
steps:
- uses: actions/checkout@v2
- id: check
run: |
if [ '${{ needs.changes.outputs.aws }}' == 'true' ]; then
echo "::set-output name=aws::aws"
fi
if [ '${{ needs.changes.outputs.azure }}' == 'true' ]; then
echo "::set-output name=azure::azure"
fi
if [ '${{ needs.changes.outputs.gcp }}' == 'true' ]; then
echo "::set-output name=gcp::gcp"
fi
- name: check values
run: |
echo ${{steps.check.outputs.aws}}
echo ${{steps.check.outputs.azure}}
echo ${{steps.check.outputs.gcp}}
- uses: montudor/action-zip@v1
with:
args: zip -qq -r result.zip "${{steps.check.outputs.aws}}" "${{steps.check.outputs.azure}}" "${{steps.check.outputs.gcp}}"
- uses: actions/[email protected]
with:
name: my-artifact
path: ${{ github.workspace }}/result.zip