Closed jeacott1 closed 1 year ago
Releases are attached to a tag and tags are not tied to a branch. They are distinct references and the action has no way to know from which branch a tag was created.
The action will query the latest 10 tags and use the first one that is a valid semver. The tag is then compared against the head of the branch you specified to get the list of commits.
yeah - thats a disaster.
As a workaround, you could use the prefix
option and name your releases/tags with a different prefix for each branch.
As a workaround, you could use the
prefix
option and name your releases/tags with a different prefix for each branch.
thanks. that wont work for me. whats the point of the branch config if its not used to isolate a branch? an option if you didnt want to add it directly would be to facilitate a fromTag: setting and let users define their own logic to acquire that.
The branch
option is used to specify the branch to compare against when fetching the list of commits, so that a query like v1.0.0...main
can be used.
A fromTag
option is a good idea. Keep in mind that you'll still have the problem of somehow finding tags by branch, which is not possible from the API, as mentioned earlier. You'll have to use the git cli to obtain that info.
yeah finding the proper from tag by git in a bash action in github is straightforward.
something like this I think
- name: Get previous tag
id: previousTag
run: |
name=$(git tag --sort=-creatordate --merged ${{ github.ref_name }} -l "*" | head -n1)
echo "previousTag: $name"
echo "previousTag=$name" >> $GITHUB_ENV
Added fromTag
in v1.5.0
thank you so much!!
@NGPixel hmmm
Run ietf-tools/semver-action@v1.5.0 with: token: *** branch: main patchAll: true skipInvalidTags: true fromTag: 0.3.0 minorList: feat, feature patchList: fix, bugfix, perf, refactor, test, tests noVersionBumpBehavior: error
/home/runner/work/_actions/ietf-tools/semver-action/v1.5.0/dist/index.js:31142
latestTag = _.get(tagsRaw, 'repository.ref')
^
ReferenceError: tagsRaw is not defined
at main (/home/runner/work/_actions/ietf-tools/semver-action/v1.5.0/dist/index.js:31142:23)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
shall I create this as a new issue?
Fixed in v1.5.1
Working beautifully. Thank you so much!!
using the following config
I have 2 branches, main, and a release/xxx branch the latest tag on main is 0.3.0 the latest tag on release/xxx is 0.3.0-testing-p1
I have configured branch: main and expect tags to be found on main only.
the action outputs logs: Comparing against latest tag: 0.3.0-testing-p1
why is ietf-tools/semver-action comparing tags in different branches? this seems wrong and quite dangerous to me. am I missing something?