-
Notifications
You must be signed in to change notification settings - Fork 67
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
[BUG]: path .github/workflows/workflows.yml not commited by octokit #368
Comments
👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labled with |
Hey @muyoungko Thanks for reaching out and apologies for the trouble. Would you mind trying to use the
Let me know what you find when you get the chance. The built n SDK methods tend to handle things like escaping and encoding much better than the generic request. Not that this is the answer, but I just want to make sure it's not something else. |
I think accessing |
Yes, other files are OK, only github/workflows/*.yml this one cause 404 error. I don't know how to treat for it likes special permission or scope. |
I tried to do with
but still same result http response code 404 on path ".github/workflows/workflows.yml" |
It works. Thanks for your support. |
What happened?
When I try to commit programmatically by octokit, some path(likes .github/workflows/workflows.yml) cause 404 error.
Following code is
//upload blobs for commit
octokit.request(
POST /repos/muyoungko/my_repository/git/blobs
, {content: somebyte.toString('base64'),
encoding: 'base64',
})
//get the blob_sha from it
let blob_sha ...
//make commit tree list
let tree_list = []
tree_list.push({
"path": '.github/workflows/workflows.yml', //If I remove dot from path my code work well
"mode":'100644',
"type": 'blob',
"sha": blob_sha
})
const tree = await octokit.request(
POST /repos/muyoungko/my_repository/git/trees
, {"base_tree": last_commit_sha,
"tree": tree_list
})
const tree_sha = tree.data.sha
//create commit ERROR occured
let new_commit = await octokit.request(
POST /repos/muyoungko/my_repository/git/commits
, {"message":
aaa
,"author": {
"name": "muyoungko",
"email": "[email protected]"
},
"parents": [
last_commit_sha
],
"tree": tree_sha
})
It is just usual commit code, but if path has dot(.github directory) error is occured.
Versions
v20.0.2
Relevant log output
Code of Conduct
The text was updated successfully, but these errors were encountered: