8000 feat: add version override flags by DerekTBrown · Pull Request #92 · helm/chart-testing-action · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: add version override flags #92

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

Merged
merged 2 commits into from
Jul 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/test-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ jobs:
uses: ./
with:
version: 'v3.5.1'
yamllint_version: '1.27.1'
yamale_version: '3.0.4'
- name: Check install!
run: |
ct version
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ A GitHub Action for installing the [helm/chart-testing](https://github.com/helm/
For more information on inputs, see the [API Documentation](https://developer.github.com/v3/repos/releases/#input)

- `version`: The chart-testing version to install (default: `v3.7.0`)
- `yamllint_version`: The chart-testing version to install (default: `1.27.1`)
- `yamale_version`: The chart-testing version to install (default: `3.0.4`)

### Example Workflow

Expand Down
15 changes: 14 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,21 @@ inputs:
description: "The chart-testing version to install (default: v3.7.0)"
required: false
default: v3.7.0
yamllint_version:
description: "The yamllint version to install (default: 1.27.1)"
required: false
default: '1.27.1'
yamale_version:
description: "The yamale version to install (default: 3.0.4)"
required: false
default: '3.0.4'
runs:
using: composite
steps:
- run: "$GITHUB_ACTION_PATH/ct.sh --version ${{ inputs.version }}"
- run: |
cd $GITHUB_ACTION_PATH \
&& ./ct.sh \
--version ${{ inputs.version }} \
--yamllint-version ${{ inputs.yamllint_version }} \
--yamale-version ${{ inputs.yamale_version }}
shell: bash
28 changes: 26 additions & 2 deletions ct.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ set -o nounset
set -o pipefail

DEFAULT_CHART_TESTING_VERSION=v3.7.0
DEFAULT_YAMLLINT_VERSION=1.27.1
DEFAULT_YAMALE_VERSION=3.0.4

show_help() {
cat << EOF
Expand All @@ -17,6 +19,8 @@ EOF

main() {
local version="$DEFAULT_CHART_TESTING_VERSION"
local yamllint_version="$DEFAULT_YAMLLINT_VERSION"
local yamale_version="$DEFAULT_YAMALE_VERSION"

parse_command_line "$@"

Expand All @@ -40,6 +44,26 @@ parse_command_line() {
exit 1
fi
;;
--yamllint-version)
if [[ -n "${2:-}" ]]; then
yamllint_version="$2"
shift
else
echo "ERROR: '--yamllint-version' cannot be empty." >&2
show_help
exit 1
fi
;;
--yamale-version)
if [[ -n "${2:-}" ]]; then
yamale_version="$2"
shift
else
echo "ERROR: '--yamale-version' cannot be empty." >&2
show_help
exit 1
fi
;;
*)
break
;;
Expand Down Expand Up @@ -76,10 +100,10 @@ install_chart_testing() {
source "$venv_dir/bin/activate"

echo 'Installing yamllint...'
pip3 install yamllint==1.27.1
pip3 install "yamllint==${yamllint_version}"

echo 'Installing Yamale...'
pip3 install yamale==3.0.4
pip3 install "yamale==${yamale_version}"
fi

# https://github.com/helm/chart-testing-action/issues/62
Expand Down
0