fix(publish): Only allow valid target ids for -t#137
Merged
Conversation
With this patch, only targets defined in `.craft.yml` are accepted in the `-t` flag, also fixing #136. ```shell craft publish --help i info craft 0.13.2 dist publish NEW-VERSION οΏ½ Publish artifacts Positionals: NEW-VERSION Version to publish [string] [required] Options: --no-input Suppresses all user prompts [boolean] [default: false] --dry-run Dry run mode: do not perform any real actions [boolean] [default: false] --target, -t Publish to this target [string] [choices: "npm", "gh-pages", "gcs", "registry", "github", "release[docker]", "latest[docker]", "all", "none"] [default: "all"] --rev, -r Source revision (git SHA or tag) to publish (if not release branch head) [string] --no-merge Do not merge the release branch after publishing [boolean] [default: false] --keep-branch Do not remove release branch after merging it [boolean] [default: false] --keep-downloads Keep all downloaded files [boolean] [default: false] --no-status-check Do not check for build status [boolean] [default: false] -v, --version Show version number [boolean] -h, --help Show help [boolean] ```
Member
Author
tonyo
approved these changes
Nov 23, 2020
|
|
||
| export function getTargetId(target: TargetConfig): string { | ||
| return target.id | ||
| ? `${target.id}[${target.name}]` |
Contributor
There was a problem hiding this comment.
For me personally it would be more intuitive to swap id and name, so we e.g. have docker as the generic target, and docker[release] or docker#release as more specific one.
Member
Author
There was a problem hiding this comment.
I agree and first I thought this would be a breaking change but it won't. I'll make that change and then merge.
Thanks for the feedback!
BYK
added a commit
that referenced
this pull request
Dec 1, 2020
BYK
added a commit
that referenced
this pull request
Mar 27, 2026
## Summary - Resolves Dependabot alert #142 (CVE-2026-33750): zero-step brace sequence `{1..2..0}` causes infinite loop and ~1.9 GB memory exhaustion in `brace-expansion` < 5.0.5 - Lockfile-only update β `[email protected]` accepts `brace-expansion@^5.0.2`, so 5.0.5 is in range with no `package.json` changes needed - The remaining 5 Dependabot alerts (#141, #138, #137, #135, #133) are already fixed; no security advisories exist
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.
With this patch, only targets defined in
.craft.ymlare acceptedin the
-tflag, also fixing #136.craft publish --help i info craft 0.13.2 dist publish NEW-VERSION π« Publish artifacts Positionals: NEW-VERSION Version to publish [string] [required] Options: --no-input Suppresses all user prompts [boolean] [default: false] --dry-run Dry run mode: do not perform any real actions [boolean] [default: false] --target, -t Publish to this target [string] [choices: "npm", "gh-pages", "gcs", "registry", "github", "docker[release]", "docker[latest]", "all", "none"] [default: "all"] --rev, -r Source revision (git SHA or tag) to publish (if not release branch head) [string] --no-merge Do not merge the release branch after publishing [boolean] [default: false] --keep-branch Do not remove release branch after merging it [boolean] [default: false] --keep-downloads Keep all downloaded files [boolean] [default: false] --no-status-check Do not check for build status [boolean] [default: false] -v, --version Show version number [boolean] -h, --help Show help [boolean]