Skip to content

Test of triggering GSASII-buildtools actions #7

Test of triggering GSASII-buildtools actions

Test of triggering GSASII-buildtools actions #7

Workflow file for this run

# when run, this starts GitHub Actions workflow in another repo (GSAS-II-buildtools)
# 1) This will trigger all GitHub Actions in workflows that has
# on: repository_dispatch:
# 2) an authorized user (Brian, or perhaps organization) creates a
# personal access token.
# Do this by clicking on "picture (upper rt)
# then "Settings" in drop-down and
# then select "Developer settings" (at bottom).
# Finally select "Fine-grained tokens"
# Personal access token settings:
# select owner: APS;
# select APS/G2-bld;
# Repo permissions: contents r/w & metadata: r/o.
# 3) Save the created token in this (G2) project.
# Use repo-level settings on 2nd line from top (may be in ... menu).
# Select Actions in Secrets & variables and create a repository secret.
# Name assigned must match ${{ secrets.XXX }} in workflow's curl
# call ("Authorization:" setting)
name: Test of triggering GSASII-buildtools actions
on: workflow_dispatch
jobs:
trigger:
runs-on: ubuntu-latest
steps:
- name: Trigger Workflow in GSAS-II-buildtools
run: |
# config var follows
repo_owner="AdvancedPhotonSource"
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.PAT }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/$repo_owner/GSAS-II-buildtools/dispatches \
-d '{"event_type": "remote build", "client_payload": {"service": "remote build", "unit": false, "integration": true}}'