Reputation: 9251
I am trying to upload a Github action workflow via the Github V3 API.
I am trying to do the following to upload the main.yaml
file to .github/workflows/main.yaml
:
await this.put(`https://api.github.com/repos/${this.ownerName}/${this.repoName}/contents/.github/workflows/main.yaml`, {
message: title,
content,
sha,
branch: newBranch
})
It seems as though including the .github
in the file path of the URL returns a 404. Is it possible to upload to a hidden directory? Maybe I need to escape the .
somehow?
Upvotes: 3
Views: 282
Reputation: 974
It might be that used personal access token (PAT) has insufficient permissions. Slightly unintuitive, but to upload workflow files, the PAT needs to have a "Workflow" scope enabled too, not only have a write access to repo.
It is at tokens and looks like:
Upvotes: 3