File tree Expand file tree Collapse file tree 1 file changed +7
-26
lines changed Expand file tree Collapse file tree 1 file changed +7
-26
lines changed Original file line number Diff line number Diff line change 1- inputs :
2- if :
3- description : Your condition
4- default : true
5- step :
6- description : Your step to run if the condition is met
7- runs :
8- using : composite
9- steps :
10- - uses : actions/github-script@v4
11- with :
12- github-token : none
13- script : |
14- var fs = require('fs');
15- try {
16- fs.mkdirSync('./.github/conditional/tmp', {recursive: true});
17- } catch {
18- }
19- if(${{fromJSON(inputs.if)}}) {
20- fs.writeFileSync('./.github/conditional/tmp/action.yml', 'runs:\n using: composite\n steps:\n - ' + process.env['STEP'].replace(/\n/g, '\n '));
21- } else {
22- fs.writeFileSync('./.github/conditional/tmp/action.yml', 'runs: {using: composite, steps: []}');
23- }
24- env :
25- STEP : ${{inputs.step}}
26- - uses : ./.github/conditional/tmp
1+ name : GitHub Actions Demo
2+ on : [push]
3+ jobs :
4+ Explore-GitHub-Actions :
5+ runs-on : ubuntu-latest
6+ steps :
7+ - run : echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
You can’t perform that action at this time.
0 commit comments