diff --git a/.github/workflows/bump-api-schema-sha.yml b/.github/workflows/bump-api-schema-sha.yml index 1fce816862abe..3cfb3d9eb06cb 100644 --- a/.github/workflows/bump-api-schema-sha.yml +++ b/.github/workflows/bump-api-schema-sha.yml @@ -18,11 +18,17 @@ jobs: env: GITHUB_TOKEN: ${{ github.token }} run: | + git config user.email "bot@getsentry.com" + git config user.name "openapi-getsentry-bot" + git checkout --branch "bot/bump-api-schema-to-${sha:0:8}" + filepath="src/gatsby/utils/resolveOpenAPI.ts" sha="$(curl -sSL 'https://api.github.com/repos/getsentry/sentry-api-schema/commits/main' | awk 'BEGIN { RS=",|:{\n"; FS="\""; } $2 == "sha" { print $4 }')" sed -i -e 's|^const SENTRY_API_SCHEMA_SHA =.*$|const SENTRY_API_SCHEMA_SHA = "'$sha'"|g' "$filepath" - git config user.email "bot@getsentry.com" - git config user.name "openapi-getsentry-bot" + git add "$filepath" git commit -m "Bump API schema to ${sha:0:8}" git push + + gh pr create --fill + gh pr merge --squash