Skip to content

Commit 3d55253

Browse files
committed
Run update README once JSON validation is success
1 parent bd7ccb0 commit 3d55253

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

.github/workflows/update_readme.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,30 @@ on:
88
- "scripts/order.txt" # Order file
99
- "media/**" # Anything in 'media' folder
1010
workflow_dispatch: # Allows manual triggering in GitHub Actions UI
11+
inputs:
12+
update_readme:
13+
type: boolean
14+
required: false
15+
default: false
1116
schedule:
1217
- cron: "0 0 * * 0" # Weekly on Sundays at midnight UTC
1318

19+
workflow_run:
20+
# This workflow will run after the "Validate JSON Entries" workflow is completed
21+
workflows: ["Validate JSON Entries"]
22+
types: [completed]
23+
branches:
24+
- main
25+
1426
jobs:
1527
update-readme:
28+
# run only if the previous workflow run was successful or cron job
29+
# This is to prevent the README update from running if the JSON validation fails
30+
if: >
31+
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') ||
32+
(github.event_name == 'schedule') ||
33+
(github.event_name == 'workflow_dispatch' && github.event.inputs.update_readme == 'true')
34+
1635
runs-on: ubuntu-latest
1736
# Grant write permissions to the GITHUB_TOKEN
1837
permissions:

0 commit comments

Comments
 (0)