[FEAT] Add User as repository ruleset bypass actor#3438
Conversation
|
👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with |
5263dc0 to
252bc71
Compare
deiga
left a comment
There was a problem hiding this comment.
Thanks for contributing!
This is looking good. There are some minor changes required to get this mergeable
| data "github_user" "current" { | ||
| username = "%[3]s" | ||
| } | ||
|
|
There was a problem hiding this comment.
issue: Please create a new test case for the User bypass actor. It should use the new ConfigStateChecks instead of Check attribute
There was a problem hiding this comment.
Pull request overview
This PR updates the github_repository_ruleset resource to allow bypass_actors entries with actor_type = "User", aligning the provider schema/docs/tests with GitHub’s current repository ruleset bypass actor support.
Changes:
- Allow
Useras a validbypass_actors.actor_typeingithub_repository_rulesetschema validation and clarifyactor_idsemantics. - Extend the repository ruleset acceptance test to add a
Userbypass actor using the numeric GitHub user ID. - Update repository ruleset documentation (and its template) to list
Useras a supported actor type and describe the requiredactor_id.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
github/resource_github_repository_ruleset.go |
Extends schema validation to accept User and updates schema field descriptions for actor_id/actor_type. |
github/resource_github_repository_ruleset_test.go |
Adds an acceptance-test bypass actor for the current user via data.github_user.current.id. |
templates/resources/repository_ruleset.md.tmpl |
Updates the generated docs template to include User as a bypass actor type and clarify actor_id. |
docs/resources/repository_ruleset.md |
Updates rendered documentation to match the template and new behavior. |
|
@manugeorge04 Please rebase the PR and address comments |
910eb73 to
1cb7544
Compare
1cb7544 to
0bbb812
Compare
- Create dedicated test case for User bypass actor using ConfigStateChecks - Remove User bypass actor from existing create_branch_ruleset test - Fix actor_id description: "Some resources" -> "Some actor types"
0bbb812 to
f6c9ebb
Compare
|
Thanks for the review @deiga Have worked on the comments and rebased. qq: From what I can see, there is an automated release flow, but I wanted to know if there is a rough timeline I could expect for when this change would land in a new version? |
|
|
||
| ~> Note: at the time of writing this, the following actor types correspond to the following actor IDs: | ||
|
|
||
| - `OrganizationAdmin` -> `1` |
There was a problem hiding this comment.
Unable to apply this suggestion, do you want me to remove this line?
Co-authored-by: Timo Sand <timo.sand@iki.fi>
Co-authored-by: Timo Sand <timo.sand@iki.fi>
Resolves #3423
Before the change?
github_repository_rulesetrejectedbypass_actorswithactor_type = "User"during schema validation, even though GitHub now supports user bypass actors for repository rulesets.After the change?
github_repository_rulesetacceptsactor_type = "User"forbypass_actors.Userbypass actor using the numeric GitHub user ID.Useras a validactor_typeand clarifies thatactor_idmust be the numeric GitHub user ID.Pull request checklist
Does this introduce a breaking change?
Please see our docs on breaking changes to help!