phish108 / autotag-action

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

ensure that only tags from the current branch are used with semver #155

Open phish108 opened 2 years ago

phish108 commented 2 years ago

If multiple prereleases exist, they may confuse each other.

Add test logic that ensures that only the relevant tags are used for the latest tag

cjmanca commented 2 years ago

This may be related to the issue I'm having. I have 3 branches I use. A "main" for actual releases, "develop" which is a beta pre-release channel, and "in-progress" for the bleeding edge. I merge from in-progress into develop multiple times before eventually merging develop into main.

The first time I merged in-progress into develop, it worked fine, creating the tag 1.0.16-develop.0, but when I just attempted to do a second merge in from in-progress to develop, it tried to again use the same 1.0.16-develop.0 tag, which had already been used:

Run phish108/autotag-action@1.1.51
  with:
    github-token: ***
    dry-run: FALSE
    bump: patch
    with-v: FALSE
    release-branch: main,master
    issue-labels: enhancement
  env:
    github-token: ***
    with-v: true
    release-branch: main,develop
run for *** / ***
load the history of activity-branch develop from context ref refs/heads/develop
active branch name is develop
maching refs: 0c9ab76f[2](https://github.com/cjmanca/plex-credits-detect/runs/8052831471?check_suite_focus=true#step:2:2)e[3](https://github.com/cjmanca/plex-credits-detect/runs/8052831471?check_suite_focus=true#step:2:3)fa[4](https://github.com/cjmanca/plex-credits-detect/runs/8052831471?check_suite_focus=true#step:2:4)13f[5](https://github.com/cjmanca/plex-credits-detect/runs/8052831471?check_suite_focus=true#step:2:5)1cdb83be33b5[6](https://github.com/cjmanca/plex-credits-detect/runs/8052831471?check_suite_focus=true#step:2:6)[7](https://github.com/cjmanca/plex-credits-detect/runs/8052831471?check_suite_focus=true#step:2:7)fa9cfdf1
the previous tag of the repository {
  "name": "1.0.16-in-progress.2",
  "zipball_url": "https://api.github.com/repos/***/***/zipball/refs/tags/1.0.16-in-progress.2",
  "tarball_url": "https://api.github.com/repos/***/***/tarball/refs/tags/1.0.16-in-progress.2",
  "commit": {
    "sha": "63710346d34bbaffde471a0eccd7[8](https://github.com/cjmanca/plex-credits-detect/runs/8052831471?check_suite_focus=true#step:2:8)76566e2e86c",
    "url": "https://api.github.com/repos/***/***/commits/63710346d34bbaffde471a0eccd7876566e2e86c"
  },
  "node_id": "REF_kwDOHoPQL75yZWZzL3RhZ3MvMS4wLjE2LWluLXByb2dyZXNzLjI"
}
the previous main tag of the repository {
  "name": "v1.0.15",
  "zipball_url": "https://api.github.com/repos/***/***/zipball/refs/tags/v1.0.15",
  "tarball_url": "https://api.github.com/repos/***/***/tarball/refs/tags/v1.0.15",
  "commit": {
    "sha": "7d7714b644476c48c4[9](https://github.com/cjmanca/plex-credits-detect/runs/8052831471?check_suite_focus=true#step:2:9)430ee28938cfc5752216b",
    "url": "https://api.github.com/repos/***/***/commits/7d7714b644476c48c49430ee28938cfc5752216b"
  },
  "node_id": "REF_kwDOHoPQL7FyZWZzL3RhZ3MvdjEuMC4xNQ"
}

The repo tags: {
  "name": "1.0.16-in-progress.2",
  "zipball_url": "https://api.github.com/repos/***/***/zipball/refs/tags/1.0.16-in-progress.2",
  "tarball_url": "https://api.github.com/repos/***/***/tarball/refs/tags/1.0.16-in-progress.2",
  "commit": {
    "sha": "637[10](https://github.com/cjmanca/plex-credits-detect/runs/8052831471?check_suite_focus=true#step:2:10)346d34bbaffde471a0eccd7876566e2e86c",
    "url": "https://api.github.com/repos/***/***/commits/63710346d34bbaffde471a0eccd7876566e2e86c"
  },
  "node_id": "REF_kwDOHoPQL75yZWZzL3RhZ3MvMS4wLjE2LWluLXByb2dyZXNzLjI"
}
default to prerelease version 1.0.[16](https://github.com/cjmanca/plex-credits-detect/runs/8052831471?check_suite_focus=true#step:2:17)-develop.0
commits in branch
bump tag 1.0.16-develop.0

really add tag 1.0.16-develop.0
Error: Reference already exists