diff --git a/.github/workflows/deploy-integ.yml b/.github/workflows/deploy-integ.yml index 32c726f699..7e37bf790a 100644 --- a/.github/workflows/deploy-integ.yml +++ b/.github/workflows/deploy-integ.yml @@ -155,5 +155,26 @@ jobs: with: token: ${{ secrets.MERGE_TOKEN }} fetch-depth: 0 + # There's no way for github actions to push to a protected branch. This is a workaround + # See https://github.uint.cloudmunity/t/how-to-push-to-protected-branches-in-a-github-action/16101/30 + - name: Temporarily disable branch protection + uses: octokit/request-action@v2.x + with: + route: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins + owner: awslabs + repo: service-workbench-on-aws + branch: develop + env: + GITHUB_TOKEN: ${{ secrets.MERGE_TOKEN }} - name: Check if Beta is present and add if not run: ./scripts/check-and-add-beta.sh + - name: Enable branch protection + uses: octokit/request-action@v2.x + if: always() # Make sure to enable branch protection even if other steps fail + with: + route: POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins + owner: awslabs + repo: service-workbench-on-aws + branch: develop + env: + GITHUB_TOKEN: ${{ secrets.MERGE_TOKEN }}