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

Missing visibility body parameter when creating organization secrets #3778

Open
mark-trellix opened this issue Jul 11, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@mark-trellix
Copy link

Attempted to generate a key pair for GitHub (self-hosted enterprise) organization and resulted in a error 422 Invalid request

After attempting to generate keys with the GitHub organization method/option:

export GITHUB_HOST="<ENTERPRISE_GITHUB>"
export GITHUB_TOKEN="github_pat_xxxxxxxxxxxxxx"
cosign generate-key-pair github://<ORG>

The following error occurs:

Error: could not create "COSIGN_PASSWORD" github actions secret: PUT https://<ENTERPRISE_GITHUB>/api/v3/orgs/<ORG>/actions/secrets/COSIGN_PASSWORD: 422 Invalid request.

"visibility" wasn't supplied. []
main.go:74: error during command execution: could not create "COSIGN_PASSWORD" github actions secret: PUT https://<ENTERPRISE_GITHUB>/api/v3/orgs/<ORG>/actions/secrets/COSIGN_PASSWORD: 422 Invalid request.

"visibility" wasn't supplied. []

It appears that possibly the required request body parameter visibility is missing when making the create organization secret request as noted in the GitHub docs create-or-update-an-organization-secret

The docs specify that visibility should either be all, private, or selected. I believe ours is set to private for our case, but in this case there is not even a default selected.

Bug: missing visibility body parameter when creating organization secrets.

Related Issue: #3566
Related PR: #3567

Version

GitVersion: v2.2.4
GitCommit: fb651b4
GitTreeState: clean
BuildDate: 2024-04-10T21:57:27Z
GoVersion: go1.21.8
Compiler: gc
Platform: linux/amd64

@mark-trellix mark-trellix added the bug Something isn't working label Jul 11, 2024
@sachincool
Copy link

Facing the same problem, thank you for elaborating and creating an issue here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants