|
74 | 74 | else
|
75 | 75 | echo "No change in package.json, not regenerating third-party notices"
|
76 | 76 | fi
|
| 77 | + - name: Temporarily disable branch protection |
| 78 | + id: disable-branch-protection |
| 79 | + uses: actions/github-script@v1 |
| 80 | + with: |
| 81 | + github-token: ${{ secrets.OPENSOURCE_BOT_TOKEN }} |
| 82 | + previews: luke-cage-preview |
| 83 | + script: | |
| 84 | + const result = await github.repos.updateBranchProtection({ |
| 85 | + owner: context.repo.owner, |
| 86 | + repo: context.repo.repo, |
| 87 | + branch: 'develop', |
| 88 | + restrictions: null, |
| 89 | + enforce_admins: null, |
| 90 | + required_pull_request_reviews: null |
| 91 | + }) |
| 92 | + console.log("Result:", result) |
77 | 93 |
|
78 | 94 | - name: Push Commit
|
79 | 95 | if: steps.generate-notices.outputs.commit == 'true'
|
|
82 | 98 | github_token: ${{ secrets.OPENSOURCE_BOT_TOKEN }}
|
83 | 99 | branch: develop
|
84 | 100 |
|
| 101 | + - name: Re-enable branch protection |
| 102 | + id: enable-branch-protection |
| 103 | + if: always() |
| 104 | + uses: actions/github-script@v1 |
| 105 | + with: |
| 106 | + github-token: ${{ secrets.OPENSOURCE_BOT_TOKEN }} |
| 107 | + previews: luke-cage-preview |
| 108 | + script: | |
| 109 | + const result = await github.repos.updateBranchProtection({ |
| 110 | + owner: context.repo.owner, |
| 111 | + repo: context.repo.repo, |
| 112 | + branch: 'develop', |
| 113 | + restrictions: { |
| 114 | + users: [], |
| 115 | + teams: ['developer-enablement'] |
| 116 | + }, |
| 117 | + enforce_admins: true, |
| 118 | + required_pull_request_reviews: { |
| 119 | + dismiss_stale_reviews: true, |
| 120 | + required_approving_review_count: 1 |
| 121 | + } |
| 122 | + }) |
| 123 | + console.log("Result:", result) |
| 124 | +
|
85 | 125 | job-generate-release:
|
86 | 126 | runs-on: ubuntu-latest
|
87 | 127 | needs: [job-generate-third-party-notices]
|
|
0 commit comments