|
1 | | -# when run, this starts GitHub Actions workflow in another repo (GSAS-II-buildtools) |
| 1 | +# Triggers buildtools workflow when a new version tag is created in GSAS-II |
2 | 2 |
|
3 | | -# 1) This will trigger all GitHub Actions in workflows that has |
| 3 | +# 1) This will trigger GitHub Actions in GSAS-II-buildtools workflows that have |
4 | 4 | # on: repository_dispatch: |
5 | 5 | # 2) an authorized user (Brian, or perhaps organization) creates a |
6 | 6 | # personal access token. |
|
10 | 10 | # Finally select "Fine-grained tokens" |
11 | 11 | # Personal access token settings: |
12 | 12 | # select owner: APS; |
13 | | -# select APS/G2-bld; |
| 13 | +# select APS/GSAS-II-buildtools; |
14 | 14 | # Repo permissions: contents r/w & metadata: r/o. |
15 | | -# 3) Save the created token in this (G2) project. |
| 15 | +# 3) Save the created token in this (GSAS-II) project. |
16 | 16 | # Use repo-level settings on 2nd line from top (may be in ... menu). |
17 | 17 | # Select Actions in Secrets & variables and create a repository secret. |
18 | 18 | # Name assigned must match ${{ secrets.XXX }} in workflow's curl |
19 | 19 | # call ("Authorization:" setting) |
20 | 20 |
|
21 | | -name: Test of triggering GSASII-buildtools actions |
| 21 | +name: Trigger buildtools on new version tag |
22 | 22 |
|
23 | | -on: workflow_dispatch |
| 23 | +on: |
| 24 | + push: |
| 25 | + tags: |
| 26 | + - 'v*.*.*' # Matches version tags like v5.6.7 |
| 27 | + workflow_dispatch: # Allows manual triggering for testing |
24 | 28 |
|
25 | 29 | jobs: |
26 | | - trigger: |
| 30 | + trigger-buildtools: |
27 | 31 | runs-on: ubuntu-latest |
28 | 32 |
|
29 | 33 | steps: |
30 | | - - name: Trigger Workflow in GSAS-II-buildtools |
| 34 | + - name: Trigger buildtools workflow |
31 | 35 | run: | |
32 | 36 | # config var follows |
33 | 37 | repo_owner="AdvancedPhotonSource" |
|
38 | 42 | -H "Authorization: Bearer ${{ secrets.PAT }}" \ |
39 | 43 | -H "X-GitHub-Api-Version: 2022-11-28" \ |
40 | 44 | https://api.github.com/repos/$repo_owner/GSAS-II-buildtools/dispatches \ |
41 | | - -d '{"event_type": "remote build", "client_payload": {"service": "remote build", "unit": false, "integration": true}}' |
42 | | - |
| 45 | + -d "{\"event_type\": \"new-version-tag\", \"client_payload\": {\"tag\": \"${{ github.ref_name }}\", \"sha\": \"${{ github.sha }}\"}}" |
0 commit comments