-
Notifications
You must be signed in to change notification settings - Fork 927
Add scoped token generation to github_app_token data source #3101
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
base: main
Are you sure you want to change the base?
Conversation
Allow scoping installation access tokens to specific repositories by passing the optional repositories parameter to the GitHub API. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
👋 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 |
stevehipwell
left a comment
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.
Thanks for the PR @elliotwms, I've added a couple of review comments.
|
|
||
| variable "repositories" { | ||
| type = list(string) | ||
| } No newline at end of file |
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.
Please make sure all your files have valid line endings.
| var repositories []string | ||
| if v, ok := d.GetOk("repositories"); ok { | ||
| for _, repo := range v.([]any) { | ||
| repositories = append(repositories, repo.(string)) | ||
| } | ||
| } |
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.
| var repositories []string | |
| if v, ok := d.GetOk("repositories"); ok { | |
| for _, repo := range v.([]any) { | |
| repositories = append(repositories, repo.(string)) | |
| } | |
| } | |
| var repos []string | |
| if v, ok := d.GetOk("repositories"); ok { | |
| if a, ok := v.([]any); ok { | |
| repos := make([]string, len(a)) | |
| for i, r := range a { | |
| if repo, ok := r.(string); ok { | |
| repos[i] = repo | |
| } | |
| } | |
| } | |
| } |
This would be a safer pattern.
Resolves #3102
Before the change?
repositoriesargument to thegithub_app_tokendata sourceAfter the change?
repositoriesargument to thegithub_app_tokendata sourceProof of work
Tested using
examples/github_app_token:Pull request checklist
Schema migrations have been created if needed (example)Does this introduce a breaking change?
Please see our docs on breaking changes to help!