Skip to content

Commit

Permalink
Merge pull request #199 from kaitj/enh/actions-dispatch-event
Browse files Browse the repository at this point in the history
Create actions dispatch event
  • Loading branch information
kaitj authored Oct 6, 2023
2 parents 7adde29 + 9c77979 commit 2b490ec
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/dispatch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# 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: ubutun-latest

steps:
- name: Get latest release tag
run: |
echo "LATEST_TAG=$(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-dglobus
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);

0 comments on commit 2b490ec

Please sign in to comment.