We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Create or Update A Repository Secret currently doesn't require key_id based on the docs. However, the API requires it.
key_id should be marked as required.
Request without key_id (fails):
Octokit:
const response = await this.makeRequest('PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}', { owner: "myorg", repo: "myrepo", secret_name: "mysecret", encrypted_value: "myencryptedvalue", });
The error:
{ "errorType": "HttpError", "errorMessage": "Invalid request.\n\n\"key_id\" wasn't supplied.", "code": 422, "name": "HttpError", "status": 422, "response": { "url": "https://api.github.com/repos/myorg/myrepo/actions/secrets/mysecret", "status": 422, "data": { "message": "Invalid request.\n\n\"key_id\" wasn't supplied.", "documentation_url": "https://docs.github.com/rest/reference/actions#create-or-update-a-repository-secret" } }, "request": { "method": "PUT", "url": "https://api.github.com/repos/myorg/myrepo/actions/secrets/mysecret", "headers": { "accept": "application/vnd.github.v3+json", "user-agent": "octokit-request.js/5.6.0 Node.js/14.17.0 (linux; x64)", "authorization": "token [REDACTED]", "content-type": "application/json; charset=utf-8" }, "body": "{\"encrypted_value\":\"TheEncryptedValueHere"}", "request": {} }, "stack": [ "HttpError: Invalid request.", "", "\"key_id\" wasn't supplied.", " at /var/task/index.js:3:35066", " at processTicksAndRejections (internal/process/task_queues.js:95:5)", " at async XI (/var/task/index.js:5:53816)", " at async DA.addSecretToRepo (/var/task/index.js:100:105846)", " at async Promise.all (index 0)", " at async DA.setSecretsOnRepo (/var/task/index.js:100:105423)", " at async bL (/var/task/index.js:100:106485)", " at async QOe (/var/task/index.js:101:1623)", " at async Runtime.GOe [as handler] (/var/task/index.js:101:1073)" ] }
However, the below request will work:
const keyResponse = await this.makeRequest('GET /repos/{owner}/{repo}/actions/secrets/public-key', { owner: "myorg", repo: "myrepo", }); const response = await this.makeRequest('PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}', { owner: "myorg", repo: "myrepo", secret_name: "mysecret", encrypted_value: "myencryptedvalue", key_id: keyResponse.data.key_id, });
octokit/request.js#403
The text was updated successfully, but these errors were encountered:
@AjkayAlan - Thanks for opening this issue, we will add it to our backlog for further triage.
Sorry, something went wrong.
No branches or pull requests
Schema Inaccuracy
Create or Update A Repository Secret currently doesn't require key_id based on the docs. However, the API requires it.
Expected
key_id should be marked as required.
Reproduction Steps
Request without key_id (fails):
Octokit:
The error:
However, the below request will work:
Related
octokit/request.js#403
The text was updated successfully, but these errors were encountered: