Skip to content

Commit

Permalink
feat: trigger example github action
Browse files Browse the repository at this point in the history
  • Loading branch information
sanyu1225 committed Mar 22, 2024
1 parent 508ca0b commit 06392fe
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,18 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Set version from publishedPackages
id: setVersion
if: steps.changesets.outputs.published == 'true'
env:
PACKAGE_VERSION: ${{ steps.changesets.outputs.publishedPackages }}
run: echo "PACKAGE_VERSION=$(echo $PACKAGE_VERSION | jq -r '.[0].version')" >> $GITHUB_OUTPUT

- name: Trigger example repo github action
if: steps.changesets.outputs.published == 'true'
run: |
curl -H "Authorization: Bearer ${{ secrets.DEV_GITHUB_TOKEN }}" \
-H 'Accept: application/vnd.github.everest-preview+json' \
"https://api.github.com/repos/blocto/blocto-sdk-examples/dispatches" \
-d '{"event_type": "update-package", "client_payload": {"version": "${{ steps.setVersion.outputs.PACKAGE_VERSION }}" }}'

0 comments on commit 06392fe

Please sign in to comment.