Skip to content

Commit e857840

Browse files
authored
Convert API SHA bump to a workflow (#5152)
1 parent f9a5ab3 commit e857840

File tree

2 files changed

+26
-13
lines changed

2 files changed

+26
-13
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Bump API Schema SHA
2+
on:
3+
4+
# This could be run manually, but general expectation is that this fires from GHA in
5+
# getsentry/sentry-api-schema on changes there. See:
6+
#
7+
# https://develop.sentry.dev/api/public/#build-process
8+
9+
workflow_dispatch:
10+
jobs:
11+
release:
12+
runs-on: ubuntu-latest
13+
name: "Bump API Schema SHA"
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: "Bump API Schema SHA"
17+
shell: bash
18+
env:
19+
GITHUB_TOKEN: ${{ github.token }}
20+
run: |
21+
filepath="src/gatsby/utils/resolveOpenAPI.ts"
22+
sha="$(curl -sSL 'https://api.github.com/repos/getsentry/sentry-api-schema/commits/main' | awk 'BEGIN { RS=",|:{\n"; FS="\""; } $2 == "sha" { print $4 }')"
23+
sed -i -e 's|^const SENTRY_API_SCHEMA_SHA =.*$|const SENTRY_API_SCHEMA_SHA = "'$SHA'"|g' "$filepath"
24+
git add "$filepath"
25+
git commit -m "Bump API schema to $sha"
26+
git push

scripts/bump-api-schema-sha.sh

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)