Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge to main #1117

Merged
merged 4 commits into from
Oct 28, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: Disable branch protection for publish
  • Loading branch information
LizBaker committed Oct 24, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit b5379e0e57f71a3e8368600232fd8a1f83603fac
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -34,6 +34,25 @@ jobs:
run: |
echo "//registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN" > .npmrc

- name: Temporarily disable "required_pull_request_reviews" branch protection
id: disable-branch-protection
if: always()
uses: actions/github-script@v6
with:
github-token: ${{ secrets.DOCS_ENG_BOT_TOKEN }}
previews: luke-cage-preview
script: |
const result = await github.rest.repos.updateBranchProtection({
owner: context.repo.owner,
repo: context.repo.repo,
branch: 'main',
required_status_checks: null,
restrictions: null,
enforce_admins: null,
required_pull_request_reviews: null
})
console.log("Result:", result)

- name: Lerna Publish
env:
GIT_AUTHOR_NAME: ${{ env.BOT_NAME }}
@@ -42,3 +61,24 @@ jobs:
GIT_COMMITTER_EMAIL: ${{ env.BOT_EMAIL }}
GH_TOKEN: ${{ secrets.DOCS_ENG_BOT_TOKEN }}
run: yarn release

- name: Re-enable "required_pull_request_reviews" branch protection
id: enable-branch-protection
if: always()
uses: actions/github-script@v6
with:
github-token: ${{ secrets.DOCS_ENG_BOT_TOKEN }}
previews: luke-cage-preview
script: |
const result = await github.rest.repos.updateBranchProtection({
owner: context.repo.owner,
repo: context.repo.repo,
branch: 'main',
required_status_checks: null,
restrictions: null,
enforce_admins: true,
required_pull_request_reviews: {
required_approving_review_count: 0
}
})
console.log("Result:", result)
Loading