solidsoftworks / semver-tags Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
It seems if this action has to generate a default tag it fails
Run SOLIDSoftworks/[email protected]
Generating version regex pattern
Generated pattern: ^hatch-test-suite-v(\d+)\.(\d+)\.(\d+)(-(\w[\w.]*))?(\+(\w[\w\.]*))??$
Getting previous tags
Generating version regex pattern
Generated pattern: ^hatch-test-suite-v?(\d+)\.(\d+)\.(\d+)(-(\w[\w.]*))?(\+(\w[\w\.]*))??$
No previous version tag. Using '0.1.0' as next version.
/runner/_work/_actions/SOLIDSoftworks/semver-tags/v1.5.3/dist/index.js:27572
major = match[1];
^
TypeError: Cannot read properties of null (reading '1')
at calculateNextVersion (/runner/_work/_actions/SOLIDSoftworks/semver-tags/v1.5.3/dist/index.js:27572:18)
at run (/runner/_work/_actions/SOLIDSoftworks/semver-tags/v1.5.3/dist/index.js:27685:20)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
My guess is that the match is not being populated, possibly because prefix optional=true being ignored:
const versionPattern = generateVersionPattern({ tagPrefix: tagPrefix, tagPrefixOptional: true });
Usage in question:
- name: Bump version and push tag
uses: SOLIDSoftworks/[email protected]
id: tag_version
with:
GITHUB_TOKEN: ${{ steps.secrets.outputs.GITHUB_TOKEN }}
tag-prefix: ${{ matrix.workflows }}-v
default-version: '0.1.0'
incremented-value: ${{ steps.bump_version.outputs.value }}
dry-run: ${{ github.event_name == 'pull_request' }}
Hi! Great work! Your GitHub action helped me a lot.
Still, I'm trying to implement a workflow where all pushes outside of main
branch create ...-alpha
tags and pushes to main
branch creates the usual semver tag.
What I tried:
env:
PRERELEASE: false
jobs:
self_tag:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: add prerelease variable
if: ${{ github.ref != 'refs/heads/main' }}
run: echo "PRERELEASE=alpha" >> $GITHUB_ENV
- name: add tag
uses: SOLIDSoftworks/semver-tags@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}}
tag-prefix: 'v'
default-version: '1.0.0'
prerelease: ${{ env.PRERELEASE }}
create-release: main
add-minor-tag: true
add-major-tag: true
Github Action Stdout is
Run SOLIDSoftworks/semver-tags@v1
with:
GITHUB_TOKEN: ***
tag-prefix: v
default-version: 1.0.0
prerelease: false
create-release: main
add-minor-tag: true
add-major-tag: true
incremented-value: patch
dry-run: false
env:
PRERELEASE: false
....
....
Creating new release tag: v1.0.2-false
Release is a prerelease. Skipping major tag...
Release is a prerelease. Skipping minor tag...
and if I removing
env:
PRERELEASE: false
then stdout is:
with:
GITHUB_TOKEN: ***
tag-prefix: v
default-version: 1.0.0
prerelease: $
add-minor-tag: true
add-major-tag: true
incremented-value: patch
create-release: main
dry-run: false
...
...
Creating new release tag: v1.0.1-$
Release is a prerelease. Skipping major tag...
Release is a prerelease. Skipping minor tag...
For now, I have two steps in the same workflow, wich only differs by if
condition based on the branch. Still, it will be nice to have the ability to specify prerelease tags based on the branch.
I can create a PR, but there are a few options on how it can be implemented, and I want to discuss it with you first.
Possible implementation:
if(prerelease)
in the code to check if string is false
create-release
variablewdyt?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.