[publish] Trigger update workflow on "api" repo after Publish (#9791)

So that we don't need to trigger it manually and/or wait for the cronjob.
This commit is contained in:
Nathan Rajlich
2023-04-11 23:53:46 -07:00
committed by GitHub
parent 6b9e274bc7
commit 64d9cef963
2 changed files with 16 additions and 0 deletions

View File

@@ -65,3 +65,11 @@ jobs:
NPM_TOKEN: ${{ secrets.NPM_TOKEN_ELEVATED }}
GA_TRACKING_ID: ${{ secrets.GA_TRACKING_ID }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
- name: Trigger Update
if: ${{ steps.check-release.outputs.IS_RELEASE == 'true' }}
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
script: |
const script = require('./utils/trigger-update-workflow.js')
await script({ github, context })

8
utils/trigger-update-workflow.js vendored Normal file
View File

@@ -0,0 +1,8 @@
module.exports = async ({ github, context }) => {
await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: 'api',
workflow_id: 'cron-update-build-container.yml',
ref: 'main',
});
};