From 03085f799a6b3528dc017621912be60038de1b9b Mon Sep 17 00:00:00 2001 From: Chad Whitacre Date: Thu, 16 Jun 2022 12:36:59 -0400 Subject: [PATCH] Go through a PR to work with branch protections --- .github/workflows/bump-api-schema-sha.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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