Trigger remote repository jobs #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a dispatch event to trigger workflows in associated repos | |
on: | |
workflow_dispatch: | |
push: # Trigger event on new tagged versions | |
tags: [v*] | |
jobs: | |
dispatch: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get latest release tag | |
run: | | |
echo "LATEST_TAG=$(echo `git describe --tags $(git rev-list --tags --max-count=1)`)" >> $GITHUB_ENV | |
- name: Create dispatch event for autobids-docs | |
uses: actions/github-script@v6 | |
with: | |
github-token: ${{ secrets.BP_PAT_TOKEN }} | |
script: | | |
const result = await github.rest.repos.createDispatchEvent({ | |
owner: 'khanlab', | |
repo: 'autobids-docs', | |
event_type: 'autobidsportal_release' | |
client_payload:{"version": "${{ env.LATEST_TAG }}"} | |
}) | |
console.log(result); | |
- name: Create dispatch event for autobids-globus | |
uses: actions/github-script@v6 | |
with: | |
github-token: ${{ secrets.BP_PAT_TOKEN }} | |
script: | | |
const result = await github.rest.repos.createDispatchEvent({ | |
owner: 'khanlab', | |
repo: 'autobids-globus', | |
event_type: 'autobidsportal_release' | |
client_payload:{"version": "${{ env.LATEST_TAG }}"} | |
}) | |
console.log(result); |