Skip to content
This repository was archived by the owner on Jan 13, 2023. It is now read-only.

fix: Ignore invalid git tags#68

Merged
bradbeam merged 1 commit intomasterfrom
fixTagFeetch
May 11, 2020
Merged

fix: Ignore invalid git tags#68
bradbeam merged 1 commit intomasterfrom
fixTagFeetch

Conversation

@bradbeam
Copy link
Contributor

@bradbeam bradbeam commented May 7, 2020

This filters the tags we retrieve from git. Specifically we're ignoring ^{}
because they don't play nice with version metadata.

Minor change to the checkout workflow - fetch tags only instead of
entire history. Saw the example in the readme and seemed useful.

Signed-off-by: Brad Beam brad.beam@carbonrelay.com

@jgustie
Copy link
Contributor

jgustie commented May 8, 2020

Why not just do this?

@jgustie
Copy link
Contributor

jgustie commented May 8, 2020

FWIW, those references are from annotated tags.

@bradbeam
Copy link
Contributor Author

bradbeam commented May 8, 2020

Definitely cleaner; think I got confused in understanding difference between the two.

This filters the tags we retrieve from git. Specifically we're ignoring ^{}
because they don't play nice with version metadata.

Minor change to the checkout workflow - fetch tags only instead of
entire history. Saw the example in the readme and seemed useful.

Signed-off-by: Brad Beam <brad.beam@carbonrelay.com>
Comment on lines -18 to +19
- name: Unshallow
run: git fetch --prune --unshallow
- name: Fetch tags
run: git fetch --depth=1 origin '+refs/tags/*:refs/tags/*'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just leave this like it was so it matches the documentation it came from?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was torn on switching to tags or adding in fetch-depth: 0 to save a step.

    # Number of commits to fetch. 0 indicates all history.
    # Default: 1
    fetch-depth: '

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, getting the tags is better then fetch-depth: 0. I think "new Git" lets you do git fetch --tags --depth=1 instead of spelling out the refspec.

@bradbeam bradbeam merged commit ef635ce into master May 11, 2020
@bradbeam bradbeam deleted the fixTagFeetch branch May 11, 2020 14:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants