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

fetch-tags: true doesn't actually fetch any tags #1471

Open
dataviruset opened this issue Sep 13, 2023 · 7 comments
Open

fetch-tags: true doesn't actually fetch any tags #1471

dataviruset opened this issue Sep 13, 2023 · 7 comments

Comments

@dataviruset
Copy link

dataviruset commented Sep 13, 2023

After #579 was merged and released with v3.6.0, the fetch-tags option was introduced and it's kind of a breaking change for projects that depend on reading tags from the git history. It sets --no-tags in the git fetch command run by this action. I think this new option should have defaulted to true or introduced in v4 instead where it could possibly have had the default false.

Nevertheless, using fetch-tags: true without overriding the default fetch-depth: 1 actually doesn't fetch any tags unless the workflow was triggered by a tag push. So I think it's misleading and should be changed to fetch all tags if fetch-tags is set to true. The change to the git fetch command run by this action would be to append '+refs/tags/*:refs/tags/*' (tagsRefSpec) to the end even though fetch-depth is > 0.

Related issue: #1467

A possible workaround would be to run another git fetch after using this checkout action like in #579 (comment), but that feels hacky.

Seems the author of the #579 PR also discussed supporting my use-case here: #579 (comment)
I'm sure that this added functionality would be very appreciated. Thanks for your consideration!

@tatiesmars
Copy link

Up, it would be nice to address this.

@ozancaglayan
Copy link

This is so annoying and confusing. I set fetch-depth: 1 and fetch-tags: true to express my intention to not checkout all the commits but indeed have all the tags, but no tags are fetched.

@zoj613
Copy link

zoj613 commented Oct 8, 2023

Reporting here because I spent a few days trying to figure out why my project's release workflow was failing due to the wheels having the wrong version number. After some digging, it turned out that this change was the cause of this failure since cibuildwheels could not use the tag information when buidling wheels. I had to explicitly set fetch-depth: 0 and fetch-tags: true to fix this.

@arthurfiorette
Copy link

Can confirm its still broken...

fetch-depth: 0 will be slow for big repositories... I simply added another step to manually fetch tags, which solves this issue perfectly for now.

- name: Checkout
  uses: actions/checkout@v4

- name: Fetch tags
  run: git fetch --prune --unshallow --tags

@benoit-pierre
Copy link

Another possible option is to use filters:

- uses: actions/checkout@v3
  with:
    fetch-depth: 0
    filter: tree:0

See #1396.

@ilyamt-tandemg
Copy link

Can confirm its still broken...

fetch-depth: 0 will be slow for big repositories... I simply added another step to manually fetch tags, which solves this issue perfectly for now.

- name: Checkout
  uses: actions/checkout@v4

- name: Fetch tags
  run: git fetch --prune --unshallow --tags

Please note that git fetch without --depth is like git fetch --depth 0 so basically you are doing a shallow fetch followed by a deep fetch (this is why you need --unshallow), which is similar, but with more steps, compared to just running one deep fetch once using actions/checkout.

So it is true that your solution works, it is not better but more worldly than just using this:

- name: Checkout
  uses: actions/checkout@v4
  with:
    fetch-depth: 0
    fetch-tags: true

liskin added a commit to liskin/strava-offline that referenced this issue Nov 2, 2023
kpushkaryov added a commit to plesk/debian11to12 that referenced this issue Dec 20, 2023
thatch added a commit to python-packaging/honesty that referenced this issue Jan 22, 2024
parkerbxyz added a commit to parkerbxyz/.github that referenced this issue Mar 12, 2024
thegamecracks added a commit to thegamecracks/dum-dum-irc that referenced this issue Apr 4, 2024
Michad added a commit to Michad/tilegroxy that referenced this issue Jun 15, 2024
@Aki0x137
Copy link

Aki0x137 commented Oct 5, 2024

Is this resolved?

enryH added a commit to RasmussenLab/pimms that referenced this issue Oct 9, 2024
enryH added a commit to RasmussenLab/pimms that referenced this issue Oct 22, 2024
* 🚧 switch mamba installation

- see if snakemake envs are somehow cached

* 🐛 specify python version, move ls

* 🚧 deactivate some workflow, run relatvie ls command

* try not to cache

* 🚧 test using venv created by codespace with python 3.12

- might be that I need to create (not sure what change in runner configurations)

* try to use full snakemake installation

* 🚧 use miniconda for pypi installation test

* try miniconda again

- snakemake environment has it's own mamba installation
- auto-activate environment "test"

* install build dependencies, fix ubuntu first

* 🐛 try to put mamba below 2.0

snakemake/snakemake#3108

* test should be activate per default

* 🚧 conda env not activated...

* 🐛 pip does not install in environment

* 🚧 experiment

* 🐛 shell was not iniated

* 🐛 test installing njab separately

* 🐛 order matters!

* try again new order, add umap-learn explicitly

* 🐛 do not re-install njab

* restrict scipy (trapz missing in lifelines)

latest scipy not supported by lifelines

* 🐛 exclude numpy 2.0 for now

* numpy try two

* swap numpy and njab, adapt other pkg to what it was before

* add back umap learn, relax constraints

* 🚧 in package single requirement

single packages cannot be specified to just ignore the dependencies.

* ➖ remove scipy dependency

- leave it to njab to install dependencies in a second step.

* ⬆️ remove support for python 3.8 (end-of-life)

* 🎨 setuptools_scm uses tags to determine version, add tags

* 🐛 tags not fetched without entire history

see actions/checkout#1471

* 🎨 clean-up workflow file

* ✨ add njab after update to requirements

- enable again more workflows (using mamba constraint snakemake environement)

* 🔥 remove comments, ⏪ add back tests

* 🐛 make order explicit (by feat freq or bin and bin count)

* 🐛 fix order of example more explicitly.

* 🐛 actually test latest version of pimms, remove comments

* 🐛 runs natively in colab without issues
cowboyd added a commit to thefrontside/effection-contrib that referenced this issue Nov 26, 2024
gonzaponte added a commit to gonzaponte/IC that referenced this issue Dec 18, 2024
This is because fetching tags only doesn't work. See
actions/checkout#1471

The simplest is to download the whole repo, since it's sufficiently
small. The action will take a bit longer, but that's a small price to
pay.
gonzaponte added a commit to gonzaponte/IC that referenced this issue Dec 18, 2024
This is because fetching tags only doesn't work. See
actions/checkout#1471

The simplest is to download the whole repo, since it's sufficiently
small. The action will take a bit longer, but that's a small price to
pay.
vkoukis added a commit to vkoukis/circuit-explorers that referenced this issue Dec 27, 2024
Add a GitHub Action to publish docs automatically, whenever someone
pushes against the "main" branch.

Note we have chosen to implement the actual business logic of publishing docs
as part of the Makefile, rather than as part of the GitHub Action
directly. This means we only use the GitHub action to *automate* the
invocation of pre-existing business logic.

This allows us to run the exact same logic both locally and within a
GitHub Action. See here for interesting context:

https://news.ycombinator.com/item?id=33751533

Also note we fetch tags explicitly, because the "checkout" action seems
to have broken semantics. See here for a ton of context:

actions/checkout#1471

Also note we set git-specific environment variables for author and
committer username/email explicitly to make the new commits in the
"gh-pages" branch appear as coming from the GitHub Actions bot.
Otherwise git was complaining that it couldn't determine the identity of
the author and/or committer.
See here for details:

https://github.com/actions/checkout#push-a-commit-using-the-built-in-token
https://github.com/orgs/community/discussions/26560

Finally, ensure the docs-clean target actually depends on having created
the managed Python virtualenv, because it needs Sphinx-provided
commands.

Signed-off-by: Vangelis Koukis <[email protected]>
vkoukis added a commit to vkoukis/circuit-explorers that referenced this issue Dec 27, 2024
Add a GitHub Action to publish docs automatically, whenever someone
pushes against the "main" branch.

Note we have chosen to implement the actual business logic of publishing docs
as part of the Makefile, rather than as part of the GitHub Action
directly. This means we only use the GitHub action to *automate* the
invocation of pre-existing business logic.

This allows us to run the exact same logic both locally and within a
GitHub Action. See here for interesting context:

https://news.ycombinator.com/item?id=33751533

Also note we fetch tags explicitly, because the "checkout" action seems
to have broken semantics. See here for a ton of context:

actions/checkout#1471

Also note we set git-specific environment variables for author and
committer username/email explicitly to make the new commits in the
"gh-pages" branch appear as coming from the GitHub Actions bot.
Otherwise git was complaining that it couldn't determine the identity of
the author and/or committer.
See here for details:

https://github.com/actions/checkout#push-a-commit-using-the-built-in-token
https://github.com/orgs/community/discussions/26560

Finally, ensure the docs-clean target actually depends on having created
the managed Python virtualenv, because it needs Sphinx-provided
commands.

Signed-off-by: Vangelis Koukis <[email protected]>
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

9 participants