Skip to content

Fetching tags doesn't work #206

Closed
Closed

Description

@thoward27

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.

Activity

  1. ericsciple commented on Apr 1, 2020

    @ericsciple
    Contributor

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

  2. ericsciple commented on Apr 1, 2020

    @ericsciple
    Contributor

    Also curious whether performed from a fork pr

  3. silasdavis commented on Apr 5, 2020

    @silasdavis

    The suggested command also fails for me with no kind of error message:

    Set up job
    2s
    Run actions/checkout@v2
    2s
    Run git fetch --depth=1 origin '+refs/tags/*:refs/tags/*'
    0s
    ##[error]Process completed with exit code 1.
    Run git fetch --depth=1 origin '+refs/tags/*:refs/tags/*'
      git fetch --depth=1 origin '+refs/tags/*:refs/tags/*'
      shell: /bin/bash -e {0}
    ##[error]Process completed with exit code 1.
    

    I tried quoting the refspec thinking it might be bash globbing issue

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

    This works for me

    Also curious whether performed from a fork pr

    Not from a fork for me, this is from a branch force (could that be relevant?) push

    What's with the lack of error message from git - is there some kind of additional layer here?

  4. thoward27 commented on Apr 9, 2020

    @thoward27
    Author

    I still cannot get tags to work for me.

    Tried with:

          - uses: actions/checkout@v2
            with:
              fetch-depth: 0
          - run: |
              git fetch --prune --tags
          - name: Create Release
            run: |
              echo $(git tag -l)
              echo $(git log --tags
    

    And:

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

    Neither do the trick for me.

  5. oesteban commented on Apr 10, 2020

    @oesteban

    Same here

  6. ericsciple commented on Apr 15, 2020

    @ericsciple
    Contributor

    Other than ruling out fork vs non-fork, I wonder whether there is a difference with the token?

    Could try a PAT (see token input) or deploy key (see ssh-key input), instead of using the built-in token.

  7. thoward27 commented on Apr 15, 2020

    @thoward27
    Author
  8. ericsciple commented on Apr 15, 2020

    @ericsciple
    Contributor

    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
  9. ericsciple commented on Apr 15, 2020

    @ericsciple
    Contributor

    Also confirmed with --prune works too (one of the other combinations listed). Note, testing against your repo too.

    on: push
    jobs:
      build:
        runs-on: [ubuntu-latest]
        steps:
          - uses: actions/checkout@v2
            with:
              repository: thoward27/semantic-release
          - run: |
              git fetch --prune --unshallow --tags
              echo exit code $?
              git tag --list
  10. ericsciple commented on Apr 15, 2020

    @ericsciple
    Contributor

    Here's the output from the run step:

    From https://github.com/thoward27/semantic-release
     * [new branch]      feat/ci    -> origin/feat/ci
     * [new tag]         v0.4.0     -> v0.4.0
    exit code 0
    v0.4.0
    
  11. ericsciple commented on Apr 15, 2020

    @ericsciple
    Contributor

    If those same commands dont work for you, would be good to try with a PAT or deploy key. Will help narrow whether something weird about the built-in token for your account.

  12. jasonkuhrt commented on Apr 22, 2020

    @jasonkuhrt

    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
    
  13. pllim commented on May 20, 2020

    @pllim

    I also tried the README and then found the answer at #206 (comment) . Would be nice to fix the README. Thanks for making GitHub Actions accessible for OSS!

    Unlike others, I use fork.

  14. ericsciple commented on May 20, 2020

    @ericsciple
    Contributor
  15. ericsciple commented on May 20, 2020

    @ericsciple
    Contributor

    Closing. Reopen if any issues.

  16. added a commit that references this issue on Jun 16, 2020
  17. added a commit that references this issue on Feb 18, 2021
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

      No branches or pull requests

      Issue actions