From 22cbfd3fc0401e1c101b50cc60bf27a4470e381c Mon Sep 17 00:00:00 2001 From: Jason Kai Date: Fri, 6 Oct 2023 07:46:02 -0400 Subject: [PATCH 1/2] Add action to create dispatch event --- .github/workflows/dispatch.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/dispatch.yml diff --git a/.github/workflows/dispatch.yml b/.github/workflows/dispatch.yml new file mode 100644 index 0000000..304c246 --- /dev/null +++ b/.github/workflows/dispatch.yml @@ -0,0 +1,27 @@ +# 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) From 9c779797c575faf01e187a72e58ff28ee53eb148 Mon Sep 17 00:00:00 2001 From: Jason Kai Date: Fri, 6 Oct 2023 07:48:42 -0400 Subject: [PATCH 2/2] Add step to trigger for autobids-globus --- .github/workflows/dispatch.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dispatch.yml b/.github/workflows/dispatch.yml index 304c246..3abb35f 100644 --- a/.github/workflows/dispatch.yml +++ b/.github/workflows/dispatch.yml @@ -22,6 +22,19 @@ jobs: owner: 'khanlab', repo: 'autobids-docs', event_type: 'autobidsportal_release' - client_payload:{"version": "${{ env.LATEST_TAG}}"} + client_payload:{"version": "${{ env.LATEST_TAG }}"} }) - console.log(result) + 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);