github-action-get-previous-tag icon indicating copy to clipboard operation
github-action-get-previous-tag copied to clipboard

Get latest tag (not tag associated with latest commit)

Open bakoontz2 opened this issue 2 years ago • 9 comments

bakoontz2 avatar Sep 05 '22 22:09 bakoontz2

See #31.

bakoontz2 avatar Sep 05 '22 22:09 bakoontz2

@bakoontz2 Just merged #33 to make sure we're running the latest actions/checkout version which should provide the tags. Could you rebase those changes in?

WyriHaximus avatar Sep 11 '22 17:09 WyriHaximus

Also just merged #34 which adds testing to ensure the outputs will output something and otherwise fail the pipeline.

WyriHaximus avatar Sep 12 '22 07:09 WyriHaximus

This is great, thanks! So what do you need me to do? (Sorry, don't work much with github PRs...)

bakoontz2 avatar Sep 12 '22 17:09 bakoontz2

This is great, thanks! So what do you need me to do? (Sorry, don't work much with github PRs...)

Right so first add this repository as a remote:

git remote add upstream https://github.com/WyriHaximus/github-action-get-previous-tag.git

Then fetch from that remote:

git fetch upstream 

And then rebase:

git rebase -i upstream/master

WyriHaximus avatar Sep 13 '22 21:09 WyriHaximus

Sorry, don't work much with github PRs...

Don't be, I gladly help out with any questions you might have 😃 .

WyriHaximus avatar Sep 13 '22 21:09 WyriHaximus

Ah, that makes sense. Done.

bakoontz2 avatar Sep 13 '22 22:09 bakoontz2

Thanks! (Didn't fully work out as expected, but it should be fine once merged.) Any clue why the tests are failing, it seems it isn't picking up the tag it should pick up?

WyriHaximus avatar Sep 16 '22 21:09 WyriHaximus

It's not really clear what is going on here: So the PR is running my CI tests?

At any rate, there were two issues: (1) Tags aren't copied over to forked repos by default. I had to do a git fetch --tags upstream; git push --tags. This fixed the previoustag failure. (2) There is no longer an error generated when there are no tags to be fetched. Code now checks for empty return value for tags after checking for errors. This fixed the previoustagwithfallback error.

The CI tests are returning successfully now.

bakoontz2 avatar Sep 18 '22 04:09 bakoontz2