-
Notifications
You must be signed in to change notification settings - Fork 310
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]: Escape slash in request parameters to --
#535
Comments
Can you try updating your code like so, and see if that helps return this.octokit.request('PUT /{base}/{repo}/actions/secrets/{name}', {
base: 'repos',
repo: 'org-name/repository',
name,
data
}) |
I had the same failure again. |
I was, however, able to get things to work if I did the following: let demoString = 'org--name/repository'
let split = demoString.split('/')
return this.octokit.request('PUT /{base}/{repo}/{owner}/actions/secrets/{name}', {
base: 'repos',
owner: split[0],
repo: split[1],
name,
data
}) So now I have a solution that works; however I'd still really like to see if there's a way to change the default behavior of converting things to %2F (maybe a |
--
What happened?
I'm using
octokit core
inside of a Github Action- and need to pass a string with a slash in it to arequest
. However, when I do, I get an error like this:Error
RequestError [HttpError]: Not Found at /home/runner/work/_actions/texas-mcallen-mission/actions-secret-modifier/v1.0.24/dist/index.js:2655:21 at processTicksAndRejections (node:internal/process/task_queues:96:5) at async boostrap (/home/runner/work/_actions/texas-mcallen-mission/actions-secret-modifier/v1.0.24/dist/index.js:11488:22) { status: 404, response: { url: 'https://api.github.com/repos/texas-mcallen-mission%2Fdeploy-tester/actions/secrets/TESTING_CLASPRC_JSON', status: 404, ...and so on
My code looks something like this:
this should result in a request that looks like so:
/repos/org-name/repository/secrets/chicken_nugget
but instead results in a request that looks like this:repos/org-name%2Frepository/secrets/chicken_nugget
Putting in a hard-coded request works, but in the context of a reusable workflow is not an adequate solution.
Here's a not-very-good attempt at a runkit demo:
https://runkit.com/harrierpigeon/63a23af06795d60008aa45c8
References:
https://docs.github.com/en/rest/actions/secrets?apiVersion=2022-11-28#create-or-update-a-repository-secret
Versions
octokit-core.js/4.1.0 Node.js/16.13.0
Relevant log output
Code of Conduct
The text was updated successfully, but these errors were encountered: