Skip to content

Commit effb864

Browse files
committed
test
1 parent d04c1d8 commit effb864

File tree

1 file changed

+7
-26
lines changed

1 file changed

+7
-26
lines changed

.github/workflows/action.yaml

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,7 @@
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."

0 commit comments

Comments
 (0)