Repository navigation
69 lines (63 loc) · 2.61 KB
/
Copy pathdispatch-api-consumers.yml
File metadata and controls
69 lines (63 loc) · 2.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Dispatch @sentry/api consumers
# Each published api@ release asks the repositories that depend on @sentry/api
# to pin the new version. Each one runs bump-sentry-api.yml, a thin caller of
# bump-sentry-api-consumer.yml. Craft publishes to npm before it publishes the
# GitHub release, but the registry can lag, so the dispatches wait until npm
# serves the new version.
on:
release:
types:
- published
# The dispatches use the app tokens below, not GITHUB_TOKEN.
permissions: {}
jobs:
wait-for-npm:
if: startsWith(github.event.release.tag_name, 'api@')
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
persist-credentials: false
sparse-checkout: .github/workflows/scripts/wait-for-api-release-on-npm.sh
sparse-checkout-cone-mode: false
- name: Wait for the release on npm
env:
RELEASE_TAG: ${{ github.event.release.tag_name }}
run: .github/workflows/scripts/wait-for-api-release-on-npm.sh "$RELEASE_TAG"
dispatch:
needs: wait-for-npm
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
fail-fast: false
matrix:
repo: [sentry-docs, toolkit]
include:
# Entries without an app use the release bot. It isn't known to be
# installed on sentry-docs, which keeps the app it already uses.
- repo: sentry-docs
schema-updater-app: true
name: dispatch (${{ matrix.repo }})
steps:
- name: Get auth token
id: token
uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
with:
# Name each secret explicitly. A computed secrets[...] lookup loads
# every repository secret into the runner.
client-id: ${{ matrix.schema-updater-app && vars.SENTRY_API_SCHEMA_UPDATER_APP_CLIENT_ID || vars.SENTRY_RELEASE_BOT_CLIENT_ID }}
private-key: ${{ matrix.schema-updater-app && secrets.SENTRY_API_SCHEMA_UPDATER_PRIVATE_KEY || secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }}
owner: getsentry
repositories: ${{ matrix.repo }}
permission-actions: write
# gh workflow run looks up the default branch when there's no --ref.
permission-metadata: read
# Dispatch by file name, on the repository's default branch.
- name: Dispatch the bump
env:
GH_TOKEN: ${{ steps.token.outputs.token }}
REPO: getsentry/${{ matrix.repo }}
run: gh workflow run bump-sentry-api.yml --repo "$REPO"