diff --git a/.github/workflows/update-whats-new-ids.yml b/.github/workflows/update-whats-new-ids.yml index 23334e8a856..9947ea61a95 100644 --- a/.github/workflows/update-whats-new-ids.yml +++ b/.github/workflows/update-whats-new-ids.yml @@ -40,11 +40,50 @@ jobs: git add ./src/data/whats-new-ids.json git diff-index --quiet HEAD ./src/data/whats-new-ids.json || git commit -m 'chore(whats-new-ids): updated ids' echo "::set-output name=commit::true" - # Push directly to the release branch so we get the changes included in the release PR + - name: Temporarily disable branch protection + id: disable-branch-protection + uses: actions/github-script@v1 + with: + github-token: ${{ secrets.OPENSOURCE_BOT_TOKEN }} + previews: luke-cage-preview + script: | + const result = await github.repos.updateBranchProtection({ + owner: context.repo.owner, + repo: context.repo.repo, + branch: context.payload.pull_request.head.ref, + required_status_checks: null, + restrictions: null, + enforce_admins: null, + required_pull_request_reviews: null + }) + console.log("Result:", result) + # Push directly to the current release branch so we get the changes included in the release PR - name: Push Commit if: steps.commit-changes.outputs.commit == 'true' uses: ad-m/github-push-action@v0.6.0 with: github_token: ${{ secrets.OPENSOURCE_BOT_TOKEN }} - branch: ${{ github.event.pull_request.head.ref }} \ No newline at end of file + branch: ${{ github.head_ref }} + + - name: Re-enable branch protection + id: enable-branch-protection + if: always() + uses: actions/github-script@v1 + with: + github-token: ${{ secrets.OPENSOURCE_BOT_TOKEN }} + previews: luke-cage-preview + script: | + const result = await github.repos.updateBranchProtection({ + owner: context.repo.owner, + repo: context.repo.repo, + branch: context.payload.pull_request.head.ref, + enforce_admins: true, + required_status_checks: null, + restrictions: null, + required_pull_request_reviews: { + dismiss_stale_reviews: true, + required_approving_review_count: 1 + } + }) + console.log("Result:", result) \ No newline at end of file