-
Notifications
You must be signed in to change notification settings - Fork 49
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
Add yamlfmt setup action #191
base: main
Are you sure you want to change the base?
Conversation
This commit adds a new action called "setup-yamlfmt" that installs yamlffmt into the actions environment. Signed-off-by: Adolfo García Veytia (Puerco) <puerco@chainguard.dev>
Mmh I think the linter is wrong here? 🤔 |
# - if version is "tip", install from tip of main. | ||
# - if version is "latest", look up latest release. | ||
# - otherwise, install the specified version. | ||
case ${{ inputs.version }} in | ||
tip) | ||
echo "Installing yamlfmt using go install" | ||
go install github.com/google/yamlfmt@main | ||
;; | ||
latest) | ||
tag=$(curl -L -s -u "username:${{ github.token }}" https://api.github.com/repos/google/yamlfmt/releases/latest | jq -r '.tag_name') | ||
;; | ||
*) | ||
tag="${{ inputs.version }}" | ||
esac |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the go install <repo>@<git-ref>
syntax handles main
and latest
automatically, in addition to tagged versions. Would it make sense to let the go install
command handle the version parsing here?
Yeah, I think you're right. It looks like it's treating this YAML file as a regular GitHub Actions workflow, not as an action. 🤔 |
lets ignore this one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename the action to use .yml
and not .yaml
setup-yamlfmt/action.yml
@puerco do still want this? |
@puerco gently ping |
This commit adds a new action called "setup-yamlfmt" that installs yamlfmt into the actions environment.
Signed-off-by: Adolfo García Veytia (Puerco) puerco@chainguard.dev