Skip to content

Commit d86f32a

Browse files
committed
Sync trigger-all-repos.yml from .github repo
1 parent dc19865 commit d86f32a

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Trigger Workflow on All Repos
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
workflow_file:
7+
description: 'Workflow file name to trigger (e.g., workflows-sync.yml)'
8+
required: true
9+
type: string
10+
ref:
11+
description: 'Git reference (branch/tag/SHA) to run workflow from'
12+
required: false
13+
default: 'main'
14+
type: string
15+
include_archived:
16+
description: 'Include archived repositories'
17+
required: false
18+
default: false
19+
type: boolean
20+
check_only:
21+
description: 'Only check which repos have the workflow (do not trigger)'
22+
required: false
23+
default: false
24+
type: boolean
25+
26+
jobs:
27+
trigger-all:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout repository
31+
uses: actions/checkout@main
32+
33+
- name: Set up Python
34+
uses: actions/setup-python@main
35+
with:
36+
python-version: '3.11'
37+
38+
- name: Install dependencies
39+
run: |
40+
pip install requests
41+
42+
- name: Trigger workflow on all repositories
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
45+
run: |
46+
python trigger_workflow_all_repos.py \
47+
P4X-ng \
48+
"${{ inputs.workflow_file }}" \
49+
--ref "${{ inputs.ref }}" \
50+
${{ inputs.include_archived && '--include-archived' || '' }} \
51+
${{ inputs.check_only && '--check-only' || '' }} \
52+
--delay 1.5
53+
54+
- name: Summary
55+
run: |
56+
echo "## Workflow Dispatch Summary" >> $GITHUB_STEP_SUMMARY
57+
echo "" >> $GITHUB_STEP_SUMMARY
58+
echo "**Workflow:** ${{ inputs.workflow_file }}" >> $GITHUB_STEP_SUMMARY
59+
echo "**Reference:** ${{ inputs.ref }}" >> $GITHUB_STEP_SUMMARY
60+
echo "**Include archived:** ${{ inputs.include_archived }}" >> $GITHUB_STEP_SUMMARY
61+
echo "**Check only:** ${{ inputs.check_only }}" >> $GITHUB_STEP_SUMMARY
62+
echo "" >> $GITHUB_STEP_SUMMARY
63+
echo "See logs above for detailed results." >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)