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

[UPSTREAM_BUG] tags not being feteched in in checkout v4 #41

Closed
rickstaa opened this issue Nov 1, 2023 · 2 comments
Closed

[UPSTREAM_BUG] tags not being feteched in in checkout v4 #41

rickstaa opened this issue Nov 1, 2023 · 2 comments
Labels
upstream An upstream bug causes these Issues.

Comments

@rickstaa
Copy link
Owner

rickstaa commented Nov 1, 2023

Bug Description:

A bug has been identified in version 4 of the actions/checkout GitHub Action, where the fetch-tags argument set to true fails to fetch tags. This issue is documented on GitHub.

Steps to Reproduce:

  1. Create a new repository.
  2. Add the following action file in the .github/workflows folder:
name: Create/update tag
on:
  workflow_dispatch:
jobs:
  create-tag:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-tags: true
      - uses: rickstaa/action-create-tag@v1
        id: "tag_create"
        with:
          tag: "latest"
          tag_exists_error: false
          message: "Latest release"

      # Print result using the env variable.
      -  run: |
          echo "Tag already present: ${{ env.TAG_EXISTS }}"

      # Print result using the action output.
      - run: |
          echo "Tag already present: ${{ steps.tag_create.outputs.tag_exists }}"
  1. Push the latest tag to the branch to ensure its existence.
  2. Run the action using the GitHub Action interface.
  3. Observe that the tag is not found, and a hint: Updates were rejected because the tag already exists in the remote. error is thrown.

Expected Behavior:

As per the actions/checkout documentation, the provided action recipe should fetch tags, and the tag should be recognized as already present.

Solution:

As a temporary solution, update the README to instruct users to use the fetch-depth: 0 argument to fetch all tags until GitHub issue #1471 is resolved. Once fixed, the fetch-tags: true argument can be used again.

@rickstaa rickstaa added the upstream An upstream bug causes these Issues. label Nov 1, 2023
@rickstaa
Copy link
Owner Author

rickstaa commented Nov 1, 2023

This will be fixed once #40 gets merged. Down the road, we can smoothly transition to the fetch-tags argument.

@rickstaa
Copy link
Owner Author

rickstaa commented Nov 1, 2023

I am closing this for now. I will update the documentation when actions/checkout#1471 is fixed upstream.

@rickstaa rickstaa closed this as completed Nov 1, 2023
@rickstaa rickstaa reopened this Nov 1, 2023
@rickstaa rickstaa closed this as completed Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream An upstream bug causes these Issues.
Projects
None yet
Development

No branches or pull requests

1 participant