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

Bug: latest (1.5.3) cannot tag when a previous tag does not exist #6

Open
asciifaceman opened this issue Feb 8, 2024 · 1 comment

Comments

@asciifaceman
Copy link

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' }}
@asciifaceman
Copy link
Author

Creating a dummy tag of the expected style is an interim fix - however it cannot seem to handle a prefixed default version at the moment

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

1 participant