Open dominikbraun opened 4 years ago
I think it should be:
ghr -t $GITHUB_TOKEN -u $CIRCLE_PROJECT_USERNAME -r $CIRCLE_PROJECT_REPONAME -c $CIRCLE_SHA1 v0.1.9 artifacts/
Unfortunately, that doesn't work:
This wording was changed in https://github.com/tcnksm/ghr/commit/18e905231419757c57559f9d0901d6657700c3cb, it's possible this issue was fixed as well. Are you on the latest version?
Seems like this is not the latest version. I'm currently using the CircleCI image cibuilds/github:0.10
which comes with ghr... I'll try to download and run ghr manually.
So now I get the new error message, but the error itself remains.
Invalid number of arguments: you must set a git TAG and optionally a PATH.
I think i might see the issue in the code, but I'm not part of the team. Once i get a chance to try this I'll see if i get the same error.
What piece of code do you have in mind?
Line 70 of cli.go. i think its counting your flagged params, (token, etc.) In the count. The code appears to fail now if its not exactly 1 or 2 params, the way im looking at it
I am also facing the same issue. Did anyone find a fix ?
Yes: The error occured because one of the flags (i.e. one of the environment variables) was empty, and ghr thought the path argument would be missing... yes, pretty weird.
ghr -t "${GITHUB_TOKEN}" \
-u "${CIRCLE_PROJECT_USERNAME}" \
-r "${CIRCLE_PROJECT_REPONAME}" \
-c "${CIRCLE_SHA1}" \
v0.1.9 artifacts/
That showed me that I provided an empty value for a certain flag, which I fixed then.
This also happens if you give wildcard for the path field.. That is /output/*
will not be recognized, it should be /output/
simply. This annoyed me a lot to be honest.
Ran into this as well, it looks like CIRCLE_PROJECT_REPONAME
is not defined in some cases? Perhaps this happens with a free CircleCI instance?
@dominikbraun can you close this issue? Since the problem was not on the ghr
side.
Just adding here that this happened to me when I didn't have my github token available to the cli. The error message isn't great and this would possibly benefit from better error messages
Hi,
in my CI, I'm running
to create my GH release using artifacts from the
artifacts
directory. Unfortunately, the following error occurs:Any ideas?