Skip to content

fetch-tags=true do not work when fetch-depth > 0 #1662

Open
@marcindabrowski

Description

@marcindabrowski

Description of the fetch-tags says: Whether to fetch tags, even if fetch-depth > 0,
but it seems that action in version 4.1.1 do not pull the tags, only the PR branch.

I set these action options:

fetch-depth: 1
fetch-tags: true
ref: ${{ github.head_ref }}

Activity

changed the title [-]fetch-tags=true do not work when fetch-depth != 0[/-] [+]fetch-tags=true do not work when fetch-depth > 0[/+] on Mar 15, 2024
salvianreynaldi

salvianreynaldi commented on Mar 19, 2024

@salvianreynaldi

duplicate of #1467.
From my exp, the posted workaround works (git fetch manually)

Ottapettavan

Ottapettavan commented on Mar 25, 2024

@Ottapettavan
Ottapettavan

Ottapettavan commented on Mar 25, 2024

@Ottapettavan

Description of the fetch-tags says: Whether to fetch tags, even if fetch-depth > 0, but it seems that action in version 4.1.1 do not pull the tags, only the PR branch.

I set these action options:

fetch-depth: 1
fetch-tags: true
ref: ${{ github.head_ref }}
lucasoares

lucasoares commented on Feb 27, 2025

@lucasoares

Same in here.

togakangaroo

togakangaroo commented on Mar 7, 2025

@togakangaroo

I'm seeing this as well.

I turned on action debugging and can see the git commands being run, specifically the fetch is this

git -c protocol.version=2 fetch --prune --no-recurse-submodules --depth=1 origin +c9787a9d432669beb6e566e710fe8afd6ad8f9cd:refs/remotes/origin/dev-17340

In order to do the right thing we would need the --tags flag in there

linked a pull request that will close this issue on Mar 7, 2025
rochacon

rochacon commented on Mar 7, 2025

@rochacon

@togakangaroo do you have a test repository at hand? Can you point it to my PR above and check if that fix the issue for you?

Your tip made me find the related code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @togakangaroo@rochacon@marcindabrowski@salvianreynaldi@lucasoares

      Issue actions

        fetch-tags=true do not work when fetch-depth > 0 · Issue #1662 · actions/checkout