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

"$tag_commit" == "$commit" comparison for pre_tag #233

Closed
floriancircly opened this issue Jan 3, 2023 · 1 comment
Closed

"$tag_commit" == "$commit" comparison for pre_tag #233

floriancircly opened this issue Jan 3, 2023 · 1 comment

Comments

@floriancircly
Copy link

If i run a GitHub actions workflow multiple times (with anothrNick/github-tag-action step v1.56) on the prerelease branch it always creates a new tag (but there is no new commit sha, just the new workflow run)

My parameters:

    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: '0'
      - name: Bump version and push tag
        uses: anothrNick/github-tag-action@1.36.0
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          WITH_V: true
          DEFAULT_BUMP: patch
          RELEASE_BRANCHES: main
          PRERELEASE_SUFFIX: dev
          PRERELEASE: true
          INITIAL_VERSION: 1.0.0

What I discovered in entrypoint.sh is that it checks if there is a difference within the tag_commit and the most recent commit (branch specific), but NOT the pre_tag. So it always creates a new tag if you run it in prerelase mode. In my opinion this should be intercepted, right?

tag_commit=$(git rev-list -n 1 "$tag")

# get current commit hash
commit=$(git rev-parse HEAD)

if [ "$tag_commit" == "$commit" ]
then
    echo "No new commits since previous tag. Skipping..."
    setOutput "new_tag" "$tag"
    setOutput "tag" "$tag"
    exit 0
fi```
@sbe-arg
Copy link
Collaborator

sbe-arg commented Jan 4, 2023

Good point I think we just missed this, here is a quick fix for it #234

@sbe-arg sbe-arg closed this as completed Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants