This is what I am trying:
- name: Create tag
uses: actions/github-script@v3
with:
script: |
console.log(await github.git.getRef({
owner: context.repo.owner,
ref: "refs/tags/v0.0.1",
repo: context.repo.repo,
}));
However, it is producing "Not Found" error.
If I check using git, I can see that tag exists:
$ git ls-remote
From git@github.com:contra/contra-deploy-tools.git
fc857fff2008eca7c4a547ad4bb35cd7ef5f3891 HEAD
fc857fff2008eca7c4a547ad4bb35cd7ef5f3891 refs/heads/main
b4e20f75a51aac030e3d8ca1360ee1ff84f10c18 refs/tags/v0.0.1
It appears like this is a permission issue. However, I am able to create a tag, and workflow permissions are configured to "Read and write permissions".
What's more surprising is that I am able to list references within the workflow:
Run git ls-remote
From https://github.com/contra/contra-deploy-tools
f0191b469168aa48ee177d270fa2af507d3f7710 HEAD
f0191b469168aa48ee177d270fa2af507d3f7710 refs/heads/main
b4e20f75a51aac030e3d8ca1360ee1ff84f10c18 refs/tags/v0.0.1
This seems to be API specific issue.
What am I missing?