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

Look further back in history? #23

Open
cmsj opened this issue Apr 27, 2021 · 3 comments
Open

Look further back in history? #23

cmsj opened this issue Apr 27, 2021 · 3 comments
Milestone

Comments

@cmsj
Copy link

cmsj commented Apr 27, 2021

Hey

I'm working on an Actions workflow to gather some information about PRs that were merged in a particular release, triggered by the creation of a new tag.

So for example if I tag 1.1 I would want to be able to run some git commands that specify a range of 1.0..1.1.

This action is excellent for getting the 1.1, but AFAICT I can't use it to figure out what the tag before that was (ie the 1.0).

Is that something that could be added?

@WyriHaximus
Copy link
Owner

That should be possible, does git support this out of the box? If so how? Otherwise, we could look at regexp or another way of matching.

Just to complete idea of what you're trying to do: You have several version branches like 1.1.x, 1.x.x, 1.0.x`. And you went per branch to get the previous tag for that range was? (This is the thing I want to do in the end on my own repo's, so if that idea matches with yours that would;d be awesome.)

@cmsj
Copy link
Author

cmsj commented May 1, 2021

I ended up with this incantation:

      - name: Get previous tag name
        id: previous_tag
        run: echo "::set-output name=TAGNAME::$(git describe --abbrev=0 --tags $(git rev-list --tags --skip=1 --max-count=1))"

which seems to work, but I don't do a lot of complicated branching.

@WyriHaximus
Copy link
Owner

Ow nice one, might add the skip to the action 👍

@WyriHaximus WyriHaximus added this to the v1.5.0 milestone Jan 28, 2024
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

2 participants