Skip to content

Bypass status check only for the initial push #24615

Answered by riywo
riywo asked this question in API and Webhooks
Discussion options

You must be logged in to vote

Now I got the proper workaround.

First, push the target commit to a non-protected branch (I used a GitHub Actions workflow). Then, trigger a GitHub Actions workflow on push branch event with GitHub App token which is specified to allow bypass pull request for the protected branch (“Allow specified actors to bypass required pull requests”). In the workflow, run a job named the same as the check status job (approved in this example) before pushing to the protected branch.

jobs:
  approved:
    runs-on: ubuntu-latest
    steps:
      - run: echo "Approved!"
  push:
    runs-on: ubuntu-latest
    needs: [ approved ]
    steps:
      - id: generate-token
        uses: tibdex/github-app-token@v…

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
1 participant