Skip to content

Create or Update an Organization Secret has wrong datatype on selected_repository_ids property #275

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

Open
GregBillings opened this issue Apr 16, 2021 · 4 comments

Comments

@GregBillings
Copy link

What article on docs.github.com is affected?

https://docs.github.com/en/rest/reference/actions#create-or-update-an-organization-secret

What part(s) of the article would you like to see updated?

Under the parameters section for PUT /orgs/{org}/actions/secrets/{secret_name} the selected_repository_ids parameter says the list should be an "array of strings". However, if you send the repository ID as a string value like the following payload:

{
   "encrypted_value":"MyEncryptedString",
   "key_id":"MyKeyId",
   "visibility":"selected",
   "selected_repository_ids":[
      "12345"
   ]
}

The API returns a 422 error with the following content:

{
   "message":"Invalid request.\n\nFor 'items', \"12345\" is not an integer.",
   "documentation_url":"https://docs.github.com/rest/reference/actions#create-or-update-an-organization-secret"
}

If you instead send an array of integers, the API call succeeds.

Based on this information the following line should be changed in the documentation:

selected_repository_ids | array of strings integers

Additional information

@welcome
Copy link

welcome bot commented Apr 16, 2021

Thanks for opening this issue. A GitHub docs team member should be by to give feedback soon. In the meantime, please check out the contributing guidelines.

@janiceilene
Copy link

@GregBillings Thanks so much for opening an issue! I'll triage this for the team to take a look 👀

@docubot
Copy link

docubot commented Apr 21, 2021

Thank you for opening this issue! Changes to the REST API schema can be requested in github/rest-api-description. I will transfer your issue over to that open source repo.

@skedwards88 skedwards88 transferred this issue from github/docs Apr 21, 2021
@Battleman
Copy link

This one bit me in the arse yesterday. In addition, Dependabot's sister endpoint does require a list of strings, as correctly documented. Meaning that when creating both an Action and a Dependabot secret, one needs to first use a list of integers, and then convert it to a list of strings.
Codespace secrets, in turn, are documented as requiring a list of integers (although I haven't tested myself).

Documentation should of course be adjusted, but also maybe consider aligning those three very similar methods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants