-
Notifications
You must be signed in to change notification settings - Fork 661
Revert "lock-release.yml: Use legacy branch protection instead of rulesets" #7719
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -29,26 +29,23 @@ jobs: | |||||
| owner: primer | ||||||
| repositories: react | ||||||
| private-key: ${{ secrets.PRIMER_APP_PRIVATE_KEY_SHARED }} | ||||||
| - name: Lock main branch | ||||||
| - name: Toggle rulesets | ||||||
| run: | | ||||||
| # Lock main but allow react-release-conductor team to push | ||||||
| # Allow react-release-conductor to bypass merge queue | ||||||
| gh api \ | ||||||
| --method PUT \ | ||||||
| -H "Accept: application/vnd.github+json" \ | ||||||
| -H "X-GitHub-Api-Version: 2022-11-28" \ | ||||||
| /repos/primer/react/branches/main/protection \ | ||||||
| --input - <<EOF | ||||||
| { | ||||||
| "lock_branch": true, | ||||||
| "restrictions": { | ||||||
| "teams": ["react-release-conductor"], | ||||||
| "users": [] | ||||||
| }, | ||||||
| "required_status_checks": null, | ||||||
| "enforce_admins": true, | ||||||
| "required_pull_request_reviews": null | ||||||
| } | ||||||
| EOF | ||||||
| /repos/primer/react/rulesets/4089335 \ | ||||||
| -F "bypass_actors[][actor_id]=12276524" \ | ||||||
| -f "bypass_actors[][actor_type]=Team" \ | ||||||
| -f "bypass_actors[][bypass_mode]=always" | ||||||
| gh api \ | ||||||
| --method PUT \ | ||||||
| -H "Accept: application/vnd.github+json" \ | ||||||
| -H "X-GitHub-Api-Version: 2022-11-28" \ | ||||||
| /repos/primer/react/rulesets/3801256 \ | ||||||
| -f "enforcement=active" | ||||||
|
Comment on lines
35
to
+48
|
||||||
| env: | ||||||
| GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} | ||||||
|
|
||||||
|
|
@@ -65,15 +62,32 @@ jobs: | |||||
| owner: primer | ||||||
| repositories: react | ||||||
| private-key: ${{ secrets.PRIMER_APP_PRIVATE_KEY_SHARED }} | ||||||
| - name: Unlock main branch | ||||||
| - name: Toggle rulesets | ||||||
| run: | | ||||||
| # Delete the branch protection rule entirely. | ||||||
| # Note: This workflow is the only thing using legacy branch protection. | ||||||
| # All other branch rules use rulesets, which are unaffected by this delete. | ||||||
| gh api \ | ||||||
| --method DELETE \ | ||||||
| --method PUT \ | ||||||
| -H "Accept: application/vnd.github+json" \ | ||||||
| -H "X-GitHub-Api-Version: 2022-11-28" \ | ||||||
| /repos/primer/react/rulesets/4089335 \ | ||||||
| -F "bypass_actors[]" | ||||||
|
||||||
| -F "bypass_actors[]" | |
| -f "bypass_actors=[]" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR description says the previous ruleset-based approach was reverted because bypass exceptions for release conductor do not work, but this change reintroduces ruleset bypass configuration. Can you clarify the intended behavior (rulesets vs legacy branch protection) and update either the workflow or PR description so they match?