Skip to content

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

@asciifaceman

Description

@asciifaceman

It seems if this action has to generate a default tag it fails

Run SOLIDSoftworks/semver-tags@v1.5.3
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/semver-tags@v1.5.3
        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' }}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions