Skip to content
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

Invalid argument: you must set TAG and PATH name. #122

Open
dominikbraun opened this issue Jan 28, 2020 · 13 comments
Open

Invalid argument: you must set TAG and PATH name. #122

dominikbraun opened this issue Jan 28, 2020 · 13 comments

Comments

@dominikbraun
Copy link

Hi,

in my CI, I'm running

ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} v0.1.9 artifacts/

to create my GH release using artifacts from the artifacts directory. Unfortunately, the following error occurs:

Invalid argument: you must set TAG and PATH name.

Any ideas?

@drazisil
Copy link

I think it should be:

ghr -t $GITHUB_TOKEN -u $CIRCLE_PROJECT_USERNAME -r $CIRCLE_PROJECT_REPONAME -c $CIRCLE_SHA1 v0.1.9 artifacts/

@dominikbraun
Copy link
Author

Unfortunately, that doesn't work:

image

@drazisil
Copy link

This wording was changed in 18e9052, it's possible this issue was fixed as well. Are you on the latest version?

@dominikbraun
Copy link
Author

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.

@dominikbraun dominikbraun changed the title ghr does not work ghr does not recognize tag and path arguments Jan 29, 2020
@dominikbraun
Copy link
Author

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.

@drazisil
Copy link

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.

@dominikbraun
Copy link
Author

What piece of code do you have in mind?

@drazisil
Copy link

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

@engineerakki
Copy link

I am also facing the same issue.
Did anyone find a fix ?

@dominikbraun
Copy link
Author

dominikbraun commented Jun 4, 2020

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.

I could fix the error by quoting the environment variables:

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.

@antony-jr
Copy link

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.

@dominikbraun dominikbraun changed the title ghr does not recognize tag and path arguments Invalid argument: you must set TAG and PATH name. Dec 12, 2022
@jubr
Copy link

jubr commented Oct 11, 2023

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.

@daniel-brenot
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants