Skip to content

Commit

Permalink
add hook to GSAS-II-buildtools
Browse files Browse the repository at this point in the history
  • Loading branch information
briantoby committed May 16, 2024
1 parent 3fc6dc1 commit a161562
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/TriggerRemote.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# when run, this starts GitHub Actions workflow in repo GSAS-II-buildtools
name: Trigger on GSASII-buildtools

on:
workflow_dispatch:
inputs:
target_service:
description: 'Run on GSAS-II-buildtools'
required: true
target_version:
description: 'v0.0.1'
required: true

jobs:
trigger:
runs-on: ubuntu-latest

steps:
- name: Trigger Workflow in GSAS-II-buildtools
run: |
# Set the required variables
repo_owner="AdvancedPhotonSource"
repo_name="GSAS-II-buildtools"
event_type="trigger-workflow"
service=${{ github.event.inputs.target_service }}"
version="${{ github.event.inputs.target_version }}"
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/$repo_name/dispatches \
-d "{\"event_type\": \"$event_type\", \"client_payload\": {\"service\": \"$service\", \"version\": \"$version\", \"unit\": false, \"integration\": true}}"

0 comments on commit a161562

Please sign in to comment.