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

[FEAT]: Allow Defining Actions Access Settings on a Repository #1418

Closed
1 task done
cwthrivent opened this issue Dec 8, 2022 · 8 comments · Fixed by #1448
Closed
1 task done

[FEAT]: Allow Defining Actions Access Settings on a Repository #1418

cwthrivent opened this issue Dec 8, 2022 · 8 comments · Fixed by #1448
Labels
Status: Up for grabs Issues that are ready to be worked on by anyone Type: Feature New feature or request

Comments

@cwthrivent
Copy link

cwthrivent commented Dec 8, 2022

Describe the need

In a repository, you can go to Settings -> Actions -> General and then there is a section for controlling the visibility/scope of the repository with respect to GitHub Actions. Here is a screenshot:

image

Currently, there does not seem to be a way to configure this via this Terraform provider (I apologize in advance if there is).

I found in the GitHub documentation that there is support for some API calls to fetch and set this value:

These are documented in the context of the GitHub Enterprise API, so I hope they are not out of scope for this provider. Let me know if they are.

SDK Version

No response

API Version

GitHub REST API 2022-11-28

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@cwthrivent cwthrivent added Status: Triage This is being looked at and prioritized Type: Feature New feature or request labels Dec 8, 2022
@kfcampbell kfcampbell added Status: Up for grabs Issues that are ready to be worked on by anyone Priority: Normal and removed Status: Triage This is being looked at and prioritized labels Dec 9, 2022
@kfcampbell
Copy link
Member

Ooh, you're right! This would be a great feature to implement in the provider. I've added the "Status: Up for grabs" label and I'd be happy to review PRs for this behavior.

@wwsean08
Copy link
Contributor

wwsean08 commented Dec 11, 2022

I'm curious, I feel like it would make sense for this to be added to the github_actions_repository_permissions, does that make sense to you or should it be it's own resource? This would be modifying settings on the same page which is why I think that it should be added to that resource, but it is slightly different in terms of settings, essentially what repos can reference this as opposed to the are actions allowed and what actions can this repo access.

Just wanted to check before I open a PR :)

Edit: also digging in a bit deeper, it looks like an update to go-github will be required before this can be done, as I'm not seeing any function for manipulating these settings the library.

@cwthrivent
Copy link
Author

cwthrivent commented Dec 12, 2022

@wwsean08 Thanks for engaging on this. I am not very familiar with the workflow between these repositories - does a separate issue need to be created wherever the "go-github" source code exists?

@kfcampbell
Copy link
Member

@cwthrivent the repository you're looking for is google/go-github! That's the module we use to interact with GitHub's REST API.

@kfcampbell kfcampbell added Status: Blocked Some technical or requirement is blocking the issue and removed Status: Up for grabs Issues that are ready to be worked on by anyone labels Dec 12, 2022
@s4nji
Copy link

s4nji commented Dec 13, 2022

Edit: also digging in a bit deeper, it looks like an update to go-github will be required before this can be done, as I'm not seeing any function for manipulating these settings the library.

This was added in the recent release (v48.2.0) via google/go-github#2578 so it should be ready to be added into terraform-provider-github

@kfcampbell kfcampbell added Status: Up for grabs Issues that are ready to be worked on by anyone and removed Status: Blocked Some technical or requirement is blocking the issue labels Dec 13, 2022
@kfcampbell
Copy link
Member

The project has been updated to use v48.2.0 of google/go-github, so this feature is now unblocked!

@wwsean08
Copy link
Contributor

Gotcha, I must have been looking at an older version of the source code when I was searching for the comment with the documentation URL. I can try taking a stab at this on Friday, but curious about your opinion on my proposition of adding this to the github_actions_repository_permissions resource @kfcampbell, the things modified by that resource are on the same page as what this would be modifying in the settings UI, otherwise I can learn how to create a new resource from scratch and this may take a bit longer (assuming someone doesn't beat me to it)

@kfcampbell
Copy link
Member

I'm 👍 on keeping the new functionality in the existing github_actions_repository_permissions resource!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Up for grabs Issues that are ready to be worked on by anyone Type: Feature New feature or request
Projects
None yet
4 participants