phish108 / autotag-action

A lightning fast autotagger for semver tagging in github actions
MIT License
14 stars 14 forks source link

Fails on a second tag after removing "with-v" option #183

Open kpetrykin opened 1 year ago

kpetrykin commented 1 year ago

Hello!

I started to use Auto.Tag with "with-v" option and after some time a decided to remove "v" from my tags. On the first commit everything works fine - version 2.2.6 was created after v2.2.5. But on the second commit (when I want 2.2.7) Auto.Tag found v2.2.5 again as a previous tag and failed to create 2.2.6 because it already existed.

Run phish108/autotag-action@1.1.37
run for FastSense / linkman_robot
load the history of activity-branch develop from context ref refs/heads/develop
active branch name is develop
maching refs: 714191cf1add2aa369c2eaebf2fc117[8](https://github.com/FastSense/linkman_robot/actions/runs/3900020200/jobs/6660228826#step:2:9)643b87c4
the previous tag of the repository {
  "name": "v2.2.5",
  "zipball_url": "https://api.github.com/repos/FastSense/linkman_robot/zipball/refs/tags/v2.2.5",
  "tarball_url": "https://api.github.com/repos/FastSense/linkman_robot/tarball/refs/tags/v2.2.5",
  "commit": {
    "sha": "702802680c2e7de6a20e207a24ae05d[9](https://github.com/FastSense/linkman_robot/actions/runs/3900020200/jobs/6660228826#step:2:10)0d5bd60d",
    "url": "https://api.github.com/repos/FastSense/linkman_robot/commits/702802680c2e7de6a20e207a24ae05d90d5bd60d"
  },
  "node_id": "REF_kwDOGjw8e7ByZWZzL3RhZ3MvdjIuMi41"
}
the previous main tag of the repository {
  "name": "v2.2.5",
  "zipball_url": "https://api.github.com/repos/FastSense/linkman_robot/zipball/refs/tags/v2.2.5",
  "tarball_url": "https://api.github.com/repos/FastSense/linkman_robot/tarball/refs/tags/v2.2.5",
  "commit": {
    "sha": "702802680c2e7de6a20e207a24ae05d90d5bd60d",
    "url": "https://api.github.com/repos/FastSense/linkman_robot/commits/702802680c2e7de6a20e207a24ae05d90d5bd60d"
  },
  "node_id": "REF_kwDOGjw8e7ByZWZzL3RhZ3MvdjIuMi41"
}
Warning: The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-[10](https://github.com/FastSense/linkman_robot/actions/runs/3900020200/jobs/6660228826#step:2:11)-[11](https://github.com/FastSense/linkman_robot/actions/runs/3900020200/jobs/6660228826#step:2:12)-github-actions-deprecating-save-state-and-set-output-commands/
The repo tags: {
  "name": "v2.2.5",
  "zipball_url": "https://api.github.com/repos/FastSense/linkman_robot/zipball/refs/tags/v2.2.5",
  "tarball_url": "https://api.github.com/repos/FastSense/linkman_robot/tarball/refs/tags/v2.2.5",
  "commit": {
    "sha": "702802680c2e7de6a20e207a24ae05d90d5bd60d",
    "url": "https://api.github.com/repos/FastSense/linkman_robot/commits/702802680c2e7de6a20e207a24ae05d90d5bd60d"
  },
  "node_id": "REF_kwDOGjw8e7ByZWZzL3RhZ3MvdjIuMi41"
}
default to prerelease version 2.2.6-develop.0
commits in branch
develop is a release branch
bump tag 2.2.6
Warning: The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/[20](https://github.com/FastSense/linkman_robot/actions/runs/3900020200/jobs/6660228826#step:2:21)[22](https://github.com/FastSense/linkman_robot/actions/runs/3900020200/jobs/6660228826#step:2:23)-10-11-github-actions-deprecating-save-state-and-set-output-commands/
really add tag 2.2.6
Error: Reference already exists
phish108 commented 1 year ago

Thank you for reaching out.

Could you provide a minimal action configuration, so I can see how you intend to run the action.

kpetrykin commented 1 year ago

Here is the autotag.yaml:

name: Auto.Tag

on: 
- push

jobs:
  tag:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node-version: 
        - 12
    steps: 
    - uses: phish108/autotag-action@1.1.37
      with:
        github-token: ${{secrets.GITHUB_TOKEN}}
        with-v: "false"
        release-branch: "develop"
        dry-run: "FALSE"