File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Dynamic Uses
2+ description : Dynamically resolve and use another GitHub action. Workaround for https://github.com/actions/runner/issues/895
3+ author : Jon Jensen
4+ inputs :
5+ uses :
6+ description : Action reference or path, e.g. `actions/setup-node@v3`
7+ required : true
8+ with :
9+ description : ' JSON-ified `inputs` for the action, e.g. `{"node-version": "18"}`'
10+ required : false
11+ default : " {}"
12+ outputs :
13+ outputs :
14+ description : ' JSON-ified `outputs` from the action, e.g. `{"node-version": "v18.12.0", "cache-hit": true}`'
15+ value : ${{ steps.run.outputs.outputs }}
16+ runs :
17+ using : composite
18+ steps :
19+ - name : Setup
20+ shell : bash
21+ run : |
22+ mkdir -p ./.tmp-dynamic-uses &&
23+ cat <<'DYNAMIC_USES_EOF' >./.tmp-dynamic-uses/action.yml
24+ outputs:
25+ outputs:
26+ value: ${{ '$' }}{{ toJSON(steps.run.outputs) }}
27+ runs:
28+ using: composite
29+ steps:
30+ - run: rm -rf ./.tmp-dynamic-uses
31+ shell: bash
32+ - name: Run
33+ id: run
34+ uses: ${{ inputs.uses }}
35+ with: ${{ inputs.with || '{}' }}
36+ DYNAMIC_USES_EOF
37+ - name : Run
38+ id : run
39+ uses : ./.tmp-dynamic-uses
40+ - name : Cleanup
41+ if : always() && steps.run.outcome != 'success'
42+ shell : bash
43+ run : rm -rf ./.tmp-dynamic-uses
You can’t perform that action at this time.
0 commit comments