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]: github_actions_secret use full_name of repository #1471

Closed
1 task done
paulaustin-automutatio opened this issue Jan 9, 2023 · 6 comments
Closed
1 task done
Labels
hacktoberfest Issues for participation in Hacktoberfest Status: Stale Used by stalebot to clean house Status: Up for grabs Issues that are ready to be worked on by anyone Type: Feature New feature or request

Comments

@paulaustin-automutatio
Copy link

Describe the need

Currently github_actions_secret expects only the repository name and not the full_name prefix by an organization.

For example the following doesn't work. It uses the owner of the current user (or specified on the provider).

resource "github_actions_secret" "my_secret" {
repository = "my-org/my-repo"
secret_name = "MY_SECRET"
plaintext_value = "***"
}

It generates this URL

https://api.github.com/repos/my-login/my-org/docs.automutatio.com/actions/secrets/public-key

instead of

https://api.github.com/repos/my-org/my-repo/docs.automutatio.com/actions/secrets/public-key

The only way to fix it would be to specify the owner in the provider config.

I would change github_actions_secret so that repository if presented with the 2 parts it would use the owner from there rather than assuming it was just the repository name.

Then you could do

repository = data.github_repository.repo.full_name

SDK Version

No response

API Version

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@paulaustin-automutatio paulaustin-automutatio added Status: Triage This is being looked at and prioritized Type: Feature New feature or request labels Jan 9, 2023
@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 Jan 11, 2023
@KenSpur
Copy link
Contributor

KenSpur commented Jun 21, 2023

@kfcampbell

I am working on the codespaces_secrets which will be similar #1729.

Currently name and full_name is what is used in the data sources while the resources use repository as name.

For consistency reasons would we want to move to

repository & repository_full_name and depricate the name/full_name or also use name & full_name and depricate repository as name on the resources?

@KenSpur
Copy link
Contributor

KenSpur commented Jun 21, 2023

Same for the public_key's

@kfcampbell
Copy link
Member

That is an excellent question. We should definitely shoot for consistency, though it'll probably be a little bit before we can release a breaking change. I have a weak preference for name and full_name because when I think of a repository I tend to think of the full slug (e.g. integrations/terraform-provider-github). Thoughts?

@KenSpur
Copy link
Contributor

KenSpur commented Jun 23, 2023

Concerning codespaces_secrets, i have kept the implementation focused and implemented it like the currently existing actions and dependabot secrets.

@kfcampbell name and full_name does seem to be most appropriate as targetting repositories seems generally implied in nameing etc aswel.

Should this feature request be implemented focused on just github_actions_secrets/github_*_secrets or should this be looked at more generally? As using the owner provided as env var or in the provider seems to be the general implementation (e.g. github_repository).

@kfcampbell
Copy link
Member

It should be looked at more generally...I definitely have issues with the environment variable, as it makes it difficult to use the provider anonymously and to change owners during a run. The challenge will be to improve that experience in a non-breaking manner if possible.

@nickfloyd nickfloyd added the hacktoberfest Issues for participation in Hacktoberfest label Sep 20, 2023
Copy link

👋 Hey Friends, this issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please add the Status: Pinned label if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!

@github-actions github-actions bot added the Status: Stale Used by stalebot to clean house label Jun 18, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest Issues for participation in Hacktoberfest Status: Stale Used by stalebot to clean house Status: Up for grabs Issues that are ready to be worked on by anyone Type: Feature New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants