Skip to content

Commit ab090e7

Browse files
committed
Refactoring workflow into two different jobs and adding option to not execute the second
1 parent 81c27ee commit ab090e7

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

.github/workflows/configlet-sync.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ on:
55
schedule:
66
- cron: '0 0 15 * *'
77

8+
env:
9+
EXECUTE_SECOND_JOB: true # Change to false to disable the second job
10+
811
jobs:
9-
configlet-auto-sync:
12+
sync-docs-metadata:
1013
runs-on: ubuntu-latest
1114

1215
steps:
@@ -29,6 +32,25 @@ jobs:
2932
branch: configlet-auto-sync
3033
delete-branch: true
3134

35+
check-test-sync:
36+
runs-on: ubuntu-latest
37+
needs: sync-docs-metadata
38+
39+
steps:
40+
- name: Check if second job should run
41+
run: |
42+
echo "EXECUTE_SECOND_JOB=${{ env.EXECUTE_SECOND_JOB }}"
43+
if [[ "${{ env.EXECUTE_SECOND_JOB }}" != "true" ]]; then
44+
echo "Skipping test sync job as EXECUTE_SECOND_JOB is not true"
45+
exit 0
46+
fi
47+
48+
- name: Checkout repository
49+
uses: actions/checkout@v4
50+
51+
- name: Fetch configlet
52+
run: ./bin/fetch-configlet
53+
3254
- name: Run configlet sync for test and capture output
3355
id: sync_test
3456
run: |

0 commit comments

Comments
 (0)