feat: add a dry-run input to the GitLab CI component - #91
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #60.
The GitLab component now matches the GitHub Action: a
dry-runinput threads--dry-runtosemvertag tag.dry-runis a GitLabtype: booleaninput withdefault: false, unlike the GitHub Action's string'false'. GitLab renders a boolean input as the bare wordtrue/false, which are shell builtins, so the script uses$(if $[[ inputs.dry-run ]]; then echo --dry-run; fi)on the same line asuvx. That keeps the invocation atscript[0], where the gate already looks for the version pin. A boolean also lets GitLab reject anything other than true/false when the pipeline is created, instead of the script quietly treating a typo as "off".semvertagfloor moves from>=0.1to>=0.5.0, the first release with--dry-run, matchingaction.yml.spec.inputsto be exactly{strategy, dry-run},dry-runto be a boolean defaulting tofalse,script[0]to wire the input onto--dry-run, and the semvertag floor to be at least 0.5.0. Each rule has a negative fixture.Not done here: the quick-start snippet in
docs/providers/gitlab.mdstill pinssemvertag>=0.1,<1. It never passes--dry-run, so it still works, and the new section tells readers to raise the floor when they add the flag.Verified with
just lint-ci,just test-ci(480 passed, 100% coverage),just adr-checkandjust docs-build. The script line was checked in a local POSIXsh(it expands totag --dry-runfortrueandtagforfalse). It has not been run in a real GitLab pipeline; the component isn't published to the Catalog yet.