fetch-gh-release-asset: Doesn't seem to work for private org
Hi @dsaltares thanks for developing this, does it work for private org repos, or am I missing something? I keep getting this error in my workflow jq: error (at <stdin>:1): Cannot iterate over null (null) Could not find asset id
Here is my config
- uses: dsaltares/fetch-gh-release-asset@master
with:
repo: "myorg/myrepo"
version: "latest"
file: "content.db.zip"
token: ${{ secrets.GITHUB_TOKEN }}
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 18 (8 by maintainers)
Commits related to this issue
- Add documentation for private repo This will make it easier to find, right now this crucial piece of info is in a comment in the issue https://github.com/dsaltares/fetch-gh-release-asset/issues/10#is... — committed to pmbanka/fetch-gh-release-asset by pmbanka 3 years ago
- Add documentation for private repo This will make it easier to find, right now this crucial piece of info is in a comment in the issue https://github.com/dsaltares/fetch-gh-release-asset/issues/10#is... — committed to FlatLang/fetch-release-asset by pmbanka 3 years ago
Ok, I found out what was going on. It turns out the default secrets.GITHUB_TOKEN doesn’t have enough permissions, the owner(me) has to make a personal access token with at least the scope
org:hookto be able to list release assets. And then reference it as a GitHub secret and then access itI was testing this out today and, from what I can tell, the default
GITHUB_TOKENsecret is able to list the releases and download assets.Here’s my workflow:
And the workflow run:
I’m wondering if maybe the issue is how you’re passing the token here? https://github.com/dsaltares/fetch-gh-release-asset/blob/7efc464cc8b520a51e69391e37626fa2fe07f776/fetch_github_asset.sh#L30
Maybe instead you need to use the
authorization: Bearerstyle I’m using above. I found that example in the GH Actions docs: https://docs.github.com/en/actions/reference/authentication-in-a-workflow#example-calling-the-rest-apiReporting some progress: I’m getting a 404 on the first curl request, I suspect that’s because my org is renamed so I’m investigating this.