checkout: Fetching tags doesn't work

I have tried almost every configuration of this action I can think of.

I am running:

- uses: actions/checkout@v2
- run: |
    git fetch --prune --unshallow
- run: |
    echo $(git tag -l)

I expect to see the tags from my repository in the output.

I am currently seeing nothing.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 3
  • Comments: 15 (9 by maintainers)

Commits related to this issue

Most upvoted comments

what about git fetch --prune --unshallow --tags ?

This worked for me (at first I tried the readme instructions):

-        with:
-          fetch-depth: 0
       - name: Get all git tags
-        run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
+        run: git fetch --prune --unshallow --tags

This works for me:

on: push
jobs:
  build:
    runs-on: [ubuntu-latest]
    steps:
      - uses: actions/checkout@v2
        with:
          repository: thoward27/semantic-release
      - run: |
          git fetch --unshallow --tags
          echo $?
          git tag --list

I also tried the README and then found the answer at https://github.com/actions/checkout/issues/206#issuecomment-607496604 . Would be nice to fix the README. Thanks for making GitHub Actions accessible for OSS!

Unlike others, I use fork.