question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

allow fetch tags too

See original GitHub issue

current it will add --no-tags

but i hope can fetch tag too

that is help when wanna build changelog base on tag in github actions

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:21
  • Comments:8

github_iconTop GitHub Comments

5reactions
anthony-steele-ckocommented, May 27, 2022

As a workaround, you can fetch tags as a step after the actions/checkout, as it leaves git in a valid state with credentials to do other operations. e.g.:

      - name: Checkout
        uses: actions/checkout@v3
      - name: Get tags
        run: git fetch --tags origin

As I understand it, this will fetch all tags but that’s preferable to fetching all history when you want a tag.

5reactions
anthony-steele-ckocommented, May 23, 2022

It is correct that if you add fetch-depth: 0 then you will get tags.

But this leaves you with two choices:

  • get no tags ( fetch-depth > 0 )
  • get the whole history, everything back to the start of the repo ( fetch-depth = 0 )

If you need the latest tag, then the first won’t work at all. If the repo is large and old, the then second isn’t great either.

We should be able to get a bounded number of recent commits and tags by specifying some options.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Does "git fetch --tags" include "git fetch"? - Stack Overflow
In most cases, all tags are reachable in this way. git fetch --tags fetches all tags, all commits necessary for them.
Read more >
git-fetch Documentation - Git
Fetch branches and/or tags (collectively, "refs") from one or more other repositories, along with the objects necessary to complete their histories.
Read more >
(Git) Add setting to enable "fetch all tags" by default. Make the ...
This will help to get rid of tags.In our case this is important because we never get rid of any tag because there...
Read more >
git-fetch(1) - Arch manual pages
Before fetching, remove any remote-tracking references that no longer exist on the remote. Tags are not subject to pruning if they are fetched...
Read more >
Git Fetch Command {How to Use It + Examples} - phoenixNAP
--multiple - Allows multiple <repository or group> arguments. --no-tags - Disable automatic tag following. --tags - Fetch all tags from a remote ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found