+
Skip to content

Conversation

martincostello
Copy link
Contributor

Allow the version input to be prefixed with v.


The README states that the version can be prefixed with v:

zizmor-action/README.md

Lines 196 to 200 in c17832b

*Default*: `latest`
`version` is the version of `zizmor` to use. It must be provided as
either an exact version (e.g. `v1.7.0`) or the special value `latest`,
which will always use the latest version of `zizmor`.

However, this doesn't actually work:

    - name: Lint workflows with zizmor
      uses: zizmorcore/zizmor-action@f52a838cfabf134edcbaa7c8b3677dde20045018 # v0.1.1
      with:
        persona: pedantic
        # renovate: datasource=github-releases depName=zizmor packageName=zizmorcore/zizmor
        version: 'v1.11.0'
Error: 'version' must be 'latest' or an exact X.Y.Z version
Error: Process completed with exit code 1.

Fixed by allowing an optional v at the start of the regex and then trimming it off the value before use.

Allow the `version` input to be prefixed with `v`.
@Copilot Copilot AI review requested due to automatic review settings August 12, 2025 12:32
Copy link

Kusari Analysis Results

Analysis for commit: 972c1ee, performed at: 2025-08-12T12:32:55Z

@kusari-inspector rerun - Trigger a re-analysis of this PR

@kusari-inspector feedback [your message] - Send feedback to our AI and team


Recommendation

✅ PROCEED with this Pull Request

Summary

No Flagged Issues Detected

All values appear to be within acceptable risk parameters.

No pinned version dependency changes, code issues or exposed secrets detected!

Found this helpful? Give it a 👍 or 👎 reaction!

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a validation issue where the action's version input couldn't accept version strings prefixed with v, despite the README documenting this feature. The fix updates the regex validation pattern and strips the v prefix when constructing the Docker image tag.

  • Updates version validation regex to accept optional v prefix
  • Strips v prefix from version string when building Docker image tag

@woodruffw
Copy link
Member

Hi @martincostello, thanks for the PR!

That's actually an error in the README 😅 -- I originally intended for it to be the exact tag at it appears on zizmor's Docker images: https://github.com/zizmorcore/zizmor/pkgs/container/zizmor

(I did that in turn because it's my understanding that Docker version tags are conventionally not prefixed with v, but I might be wrong about that.)

I guess I'm not opposed to allowing v as well and then stripping it off as this PR does, but out of curiosity: would it be troublesome for your use case to have it remain unprefixed?

@martincostello
Copy link
Contributor Author

I think initially it was because I thought that renovate would provide the version with the v prefix because that's the name of the tag, so I'd have to trim it myself anyway, though I've subsequently found that isn't the case.

However, for the minimal change needed to support the v prefix (e.g. if someone is manually getting the version by querying GitHub for the latest release), I think it's worth supporting anyway to make people's lives easier and avoid one possible foot-gun when adopting the tool.

@woodruffw
Copy link
Member

I think initially it was because I thought that renovate would provide the version with the v prefix because that's the name of the tag, so I'd have to trim it myself anyway, though I've subsequently found that isn't the case.

Oh, can Renovate update these kinds of version fields? That's pretty surprising to me, since in this case it's an entirely custom field that just happens to map to a Docker image tag on GHCR

I think it's worth supporting anyway to make people's lives easier and avoid one possible foot-gun when adopting the tool.

Agreed; I'll do a full review later today 🙂

@woodruffw woodruffw self-requested a review August 12, 2025 16:12
@martincostello
Copy link
Contributor Author

martincostello commented Aug 12, 2025

I thought it could, but it can't without me refactoring my initial code snippet.

I added up with this:

env:
  # renovate: datasource=github-releases depName=zizmor packageName=zizmorcore/zizmor
  ZIZMOR_VERSION: '1.11.0'

# then later...

    - name: Lint workflows with zizmor
      uses: zizmorcore/zizmor-action@f52a838cfabf134edcbaa7c8b3677dde20045018 # v0.1.1
      with:
        persona: pedantic
        version: ${{ env.ZIZMOR_VERSION }}

It leverages the customManagers:githubActionsVersions preset.

@woodruffw
Copy link
Member

Gotcha. TIL about that feature of Renovate as well.

@woodruffw woodruffw merged commit 9c58446 into zizmorcore:main Aug 13, 2025
8 checks passed
@woodruffw
Copy link
Member

Thanks @martincostello!

@martincostello martincostello deleted the allow-v-prefix branch August 13, 2025 12:55
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

Successfully merging this pull request may close these issues.

2 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载