Skip to content

Commit 8224873

Browse files
authored
Merge pull request #278 from AdvancedPhotonSource/copilot/update-trigger-remote-yml
Update TriggerRemote.yml to trigger on version tags
2 parents 89a5ea2 + 5618ab0 commit 8224873

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed
Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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
22

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
44
# on: repository_dispatch:
55
# 2) an authorized user (Brian, or perhaps organization) creates a
66
# personal access token.
@@ -10,24 +10,28 @@
1010
# Finally select "Fine-grained tokens"
1111
# Personal access token settings:
1212
# select owner: APS;
13-
# select APS/G2-bld;
13+
# select APS/GSAS-II-buildtools;
1414
# 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.
1616
# Use repo-level settings on 2nd line from top (may be in ... menu).
1717
# Select Actions in Secrets & variables and create a repository secret.
1818
# Name assigned must match ${{ secrets.XXX }} in workflow's curl
1919
# call ("Authorization:" setting)
2020

21-
name: Test of triggering GSASII-buildtools actions
21+
name: Trigger buildtools on new version tag
2222

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
2428

2529
jobs:
26-
trigger:
30+
trigger-buildtools:
2731
runs-on: ubuntu-latest
2832

2933
steps:
30-
- name: Trigger Workflow in GSAS-II-buildtools
34+
- name: Trigger buildtools workflow
3135
run: |
3236
# config var follows
3337
repo_owner="AdvancedPhotonSource"
@@ -38,5 +42,4 @@ jobs:
3842
-H "Authorization: Bearer ${{ secrets.PAT }}" \
3943
-H "X-GitHub-Api-Version: 2022-11-28" \
4044
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

Comments
 (0)