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

Fails to read/parse existing version #1

Closed
chlirre opened this issue Dec 12, 2019 · 9 comments
Closed

Fails to read/parse existing version #1

chlirre opened this issue Dec 12, 2019 · 9 comments

Comments

@chlirre
Copy link

chlirre commented Dec 12, 2019

I keep getting Version is 0.0.1+0 when using this action.

I ran https://github.com/PaulHatch/semantic-version/blob/master/index.js#L59-L66 locally as

git for-each-ref  --format='%(refname:short)' --sort=-committerdate --no-contains <commit> refs/tags/v*

and got

v0.1.5
v0.1.4
v0.1.3
v0.1.2
v0.1.1
v0.1.0

Output when running the action:

Run PaulHatch/semantic-version@v1.0.1
  with:
    branch: master
    tag_prefix: v
    format: v${major}.${minor}.${patch}
    major_pattern: (MAJOR)
    minor_pattern: (MINOR)
  env:
    GITHUB_TOKEN: ***
Version is 0.0.1+0
@PaulHatch
Copy link
Owner

Is the repo you're running this on public?

@chlirre chlirre changed the title Fails to read/parse existing tags Fails to read/parse existing version Dec 12, 2019
@chlirre
Copy link
Author

chlirre commented Dec 12, 2019

@PaulHatch Unfortunately, no.

@PaulHatch
Copy link
Owner

OK, well if you can provide some idea of the structure of this repository? The index.test.js test file has a few tests designed to test picking up the version tag, Tags start new version and Version pulled from last release branch, can you see what the difference might be? Also, what does your remote setup look like? This action assumes there is at most one remote called origin since this is the result of running actions/checkout.

@chlirre
Copy link
Author

chlirre commented Dec 12, 2019

@PaulHatch
Copy link
Owner

It seems that the latest version of the checkout action does not include tags. Using uses: actions/checkout@v1 on a fork of this worked. I'll update the action to pull tags, but perhaps only if none are present.

@chlirre
Copy link
Author

chlirre commented Dec 12, 2019

uses: actions/checkout@v1 did the trick. Works like a charm.

@PaulHatch
Copy link
Owner

NP, on further thought I don't think it is without the scope of this action to be modifying the repository. I am adding a warning message if no tags are present.

@aquaosrs
Copy link

It might be worth putting this in the readme, or updating the warning to include a message about private repos. I was just caught out by this issue. 😊

@PaulHatch
Copy link
Owner

Yes, I considered trying to detect in the action and show a warning and still might add to a future version. There's a note at the bottom of the readme with instruction on how to make this work for v2. The repository does not need to be public, I only mentioned it above to see if I could take a look so that I could troubleshoot the issue.

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

3 participants