|
1 | | -name: Trigger Workflow on All Repos |
| 1 | +name: "Trigger Workflow on All Repos" |
2 | 2 |
|
3 | 3 | on: |
4 | | - |
5 | 4 | workflow_dispatch: |
6 | | - |
7 | 5 | inputs: |
8 | | - |
9 | 6 | workflow_file: |
10 | | - |
11 | 7 | description: 'Workflow file name to trigger (e.g., workflows-sync.yml)' |
12 | | - |
13 | 8 | required: true |
14 | | - |
15 | 9 | type: string |
16 | | - |
17 | 10 | ref: |
18 | | - |
19 | 11 | description: 'Git reference (branch/tag/SHA) to run workflow from' |
20 | | - |
21 | 12 | required: false |
22 | | - |
23 | 13 | default: 'main' |
24 | | - |
25 | 14 | type: string |
26 | | - |
27 | 15 | include_archived: |
28 | | - |
29 | 16 | description: 'Include archived repositories' |
30 | | - |
31 | 17 | required: false |
32 | | - |
33 | 18 | default: false |
34 | | - |
35 | 19 | type: boolean |
36 | | - |
37 | 20 | check_only: |
38 | | - |
39 | 21 | description: 'Only check which repos have the workflow (do not trigger)' |
40 | | - |
41 | 22 | required: false |
42 | | - |
43 | 23 | default: false |
44 | | - |
45 | 24 | type: boolean |
46 | 25 |
|
47 | 26 | jobs: |
48 | | - |
49 | 27 | trigger-all: |
50 | | - |
51 | | - runs-on: self-hosted |
52 | | - |
| 28 | + runs-on: [self-hosted, linux, x64, big] |
53 | 29 | steps: |
54 | | - |
55 | 30 | - name: Checkout repository |
56 | | - |
57 | 31 | uses: actions/checkout@main |
58 | 32 |
|
59 | 33 | - name: Set up Python |
60 | | - |
61 | 34 | uses: actions/setup-python@main |
62 | | - |
63 | 35 | with: |
64 | | - |
65 | 36 | python-version: '3.11' |
66 | 37 |
|
67 | 38 | - name: Install dependencies |
68 | | - |
69 | 39 | run: | |
70 | | -
|
71 | 40 | pip install requests |
72 | 41 |
|
73 | 42 | - name: Trigger workflow on all repositories |
74 | | - |
75 | 43 | env: |
76 | | - |
77 | 44 | GITHUB_TOKEN: ${{ secrets.GH_PAT }} |
78 | | - |
79 | 45 | run: | |
80 | | -
|
81 | 46 | python trigger_workflow_all_repos.py \ |
82 | | -
|
83 | 47 | P4X-ng \ |
84 | | -
|
85 | 48 | "${{ inputs.workflow_file }}" \ |
86 | | -
|
87 | 49 | --ref "${{ inputs.ref }}" \ |
88 | | -
|
89 | 50 | ${{ inputs.include_archived && '--include-archived' || '' }} \ |
90 | | -
|
91 | 51 | ${{ inputs.check_only && '--check-only' || '' }} \ |
92 | | -
|
93 | 52 | --delay 1.5 |
94 | 53 |
|
95 | 54 | - name: Summary |
96 | | - |
97 | 55 | run: | |
98 | | -
|
99 | 56 | echo "## Workflow Dispatch Summary" >> $GITHUB_STEP_SUMMARY |
100 | | -
|
101 | 57 | echo "" >> $GITHUB_STEP_SUMMARY |
102 | | -
|
103 | 58 | echo "**Workflow:** ${{ inputs.workflow_file }}" >> $GITHUB_STEP_SUMMARY |
104 | | -
|
105 | 59 | echo "**Reference:** ${{ inputs.ref }}" >> $GITHUB_STEP_SUMMARY |
106 | | -
|
107 | 60 | echo "**Include archived:** ${{ inputs.include_archived }}" >> $GITHUB_STEP_SUMMARY |
108 | | -
|
109 | 61 | echo "**Check only:** ${{ inputs.check_only }}" >> $GITHUB_STEP_SUMMARY |
110 | | -
|
111 | 62 | echo "" >> $GITHUB_STEP_SUMMARY |
112 | | -
|
113 | 63 | echo "See logs above for detailed results." >> $GITHUB_STEP_SUMMARY |
114 | | -
|
0 commit comments