Skip to content

[FEAT] Add User as repository ruleset bypass actor#3438

Open
manugeorge04 wants to merge 4 commits into
integrations:mainfrom
manugeorge04:add-user-repository-ruleset-bypass-actor
Open

[FEAT] Add User as repository ruleset bypass actor#3438
manugeorge04 wants to merge 4 commits into
integrations:mainfrom
manugeorge04:add-user-repository-ruleset-bypass-actor

Conversation

@manugeorge04
Copy link
Copy Markdown

Resolves #3423


Before the change?

  • github_repository_ruleset rejected bypass_actors with actor_type = "User" during schema validation, even though GitHub now supports user bypass actors for repository rulesets.

After the change?

  • github_repository_ruleset accepts actor_type = "User" for bypass_actors.
  • The repository ruleset acceptance test now exercises a User bypass actor using the numeric GitHub user ID.
  • Repository ruleset documentation now lists User as a valid actor_type and clarifies that actor_id must be the numeric GitHub user ID.

Pull request checklist

  • Schema migrations have been created if needed (example)
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)

Does this introduce a breaking change?

Please see our docs on breaking changes to help!

  • Yes
  • No

@github-actions
Copy link
Copy Markdown

👋 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 Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

@manugeorge04 manugeorge04 force-pushed the add-user-repository-ruleset-bypass-actor branch from 5263dc0 to 252bc71 Compare May 20, 2026 21:11
@manugeorge04 manugeorge04 changed the title Add User as repository ruleset bypass actor [FEAT] Add User as repository ruleset bypass actor May 20, 2026
Copy link
Copy Markdown
Collaborator

@deiga deiga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing!
This is looking good. There are some minor changes required to get this mergeable

Comment on lines +32 to +35
data "github_user" "current" {
username = "%[3]s"
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: Please create a new test case for the User bypass actor. It should use the new ConfigStateChecks instead of Check attribute

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 User as a valid bypass_actors.actor_type in github_repository_ruleset schema validation and clarify actor_id semantics.
  • Extend the repository ruleset acceptance test to add a User bypass actor using the numeric GitHub user ID.
  • Update repository ruleset documentation (and its template) to list User as a supported actor type and describe the required actor_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.

Comment thread github/resource_github_repository_ruleset.go
Comment thread github/resource_github_repository_ruleset.go
@deiga
Copy link
Copy Markdown
Collaborator

deiga commented Jun 2, 2026

@manugeorge04 Please rebase the PR and address comments

@deiga deiga added this to the v6.13.0 milestone Jun 2, 2026
@deiga deiga added Type: Feature New feature or request vNext Awaiting response and removed vNext labels Jun 2, 2026
@manugeorge04 manugeorge04 force-pushed the add-user-repository-ruleset-bypass-actor branch 2 times, most recently from 910eb73 to 1cb7544 Compare June 4, 2026 21:19
@manugeorge04 manugeorge04 force-pushed the add-user-repository-ruleset-bypass-actor branch from 1cb7544 to 0bbb812 Compare June 4, 2026 21:19
- 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"
@manugeorge04 manugeorge04 force-pushed the add-user-repository-ruleset-bypass-actor branch from 0bbb812 to f6c9ebb Compare June 4, 2026 21:39
@manugeorge04
Copy link
Copy Markdown
Author

manugeorge04 commented Jun 4, 2026

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?

Comment thread github/resource_github_repository_ruleset.go Outdated

~> Note: at the time of writing this, the following actor types correspond to the following actor IDs:

- `OrganizationAdmin` -> `1`
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unable to apply this suggestion, do you want me to remove this line?

Comment thread templates/resources/repository_ruleset.md.tmpl Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

manugeorge04 and others added 2 commits June 5, 2026 23:19
Co-authored-by: Timo Sand <timo.sand@iki.fi>
Co-authored-by: Timo Sand <timo.sand@iki.fi>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT]: Support User actor type in bypass_actors for ruleset

3 participants