Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: helm/chart-testing-action
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.2.1
Choose a base ref
...
head repository: helm/chart-testing-action
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.3.0
Choose a head ref
  • 5 commits
  • 4 files changed
  • 6 contributors

Commits on Apr 6, 2022

  1. fix: Typo in README (#81)

    PR #75 had a small typo in the args to `ct` - it should be `--target-branch`.
    
    Also, rather than hard-coding `main`, we can use the event [context][1] to get the name of the
    default branch if it's something different (eg `master`).
    
    [1]: https://docs.github.com/en/actions/learn-github-actions/contexts
    
    Signed-off-by: Joe Horsnell <github@joehorsnell.com>
    
    Co-authored-by: automation <automation@bitso.com>
    joehorsnell and automation authored Apr 6, 2022
    Copy the full SHA
    c027be8 View commit details

Commits on May 25, 2022

  1. Specify target branch of ct lint in example workflow (#88)

    Signed-off-by: JenTing Hsiao <hsiaoairplane@gmail.com>
    JenTing Hsiao authored May 25, 2022

    Verified

    This commit was signed with the committer’s verified signature.
    gustavste Gustav
    Copy the full SHA
    e38d23e View commit details

Commits on Jul 13, 2022

  1. chore: update yamllint version (#91)

    Signed-off-by: Derek Brown <derek.brown@lacework.net>
    DerekTBrown authored Jul 13, 2022
    Copy the full SHA
    729b0c1 View commit details

Commits on Jul 28, 2022

  1. update action to default chart-testing install to v3.7.0 (#94)

    Signed-off-by: cpanato <ctadeu@gmail.com>
    cpanato authored Jul 28, 2022
    Copy the full SHA
    6930ae8 View commit details

Commits on Jul 29, 2022

  1. feat: add version override flags (#92)

    Signed-off-by: Derek Brown <derek.brown@lacework.net>
    Derek Brown authored Jul 29, 2022
    Copy the full SHA
    09ed887 View commit details
Showing with 75 additions and 14 deletions.
  1. +25 −3 .github/workflows/test-action.yml
  2. +7 −5 README.md
  3. +16 −3 action.yml
  4. +27 −3 ct.sh
28 changes: 25 additions & 3 deletions .github/workflows/test-action.yml
Original file line number Diff line number Diff line change
@@ -12,7 +12,17 @@ jobs:
- name: Install chart-testing
uses: ./
- name: Check install!
run: ct version
run: |
ct version
CT_VERSION_OUTPUT=$(ct version 2>&1 /dev/null)
ACTUAL_VERSION=$(echo "$CT_VERSION_OUTPUT" | grep Version | rev | cut -d ' ' -f1 | rev)
if [[ $ACTUAL_VERSION != 'v3.7.0' ]]; then
echo 'should be v3.7.0'
exit 1
else
exit 0
fi
shell: bash
- name: Check root directory
run: |
if [[ $(git diff --stat) != '' ]]; then
@@ -31,9 +41,21 @@ jobs:
- name: Install chart-testing
uses: ./
with:
version: 'v3.4.0'
version: 'v3.5.1'
yamllint_version: '1.27.1'
yamale_version: '3.0.4'
- name: Check install!
run: ct version
run: |
ct version
CT_VERSION_OUTPUT=$(ct version 2>&1 /dev/null)
ACTUAL_VERSION=$(echo "$CT_VERSION_OUTPUT" | grep Version | rev | cut -d ' ' -f1 | rev)
if [[ $ACTUAL_VERSION != 'v3.5.1' ]]; then
echo 'should be v3.5.1'
exit 1
else
exit 0
fi
shell: bash
- name: Check root directory
run: |
if [[ $(git diff --stat) != '' ]]; then
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -15,7 +15,9 @@ 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.5.0`)
- `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

@@ -42,7 +44,7 @@ jobs:
- name: Set up Helm
uses: azure/setup-helm@v1
with:
version: v3.8.1
version: v3.9.2

- uses: actions/setup-python@v2
with:
@@ -54,13 +56,13 @@ jobs:
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --targer-branch main)
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
fi
- name: Run chart-testing (lint)
run: ct lint
run: ct lint --target-branch ${{ github.event.repository.default_branch }}

- name: Create kind cluster
uses: helm/kind-action@v1.2.0
@@ -70,7 +72,7 @@ jobs:
run: ct install
```
This uses [`helm/kind-action`](https://www.github.com/helm/kind-action) GitHub Action to spin up a [kind](https://kind.sigs.k8s.io/) Kubernetes cluster,
This uses [`helm/kind-action`](https://www.github.com/helm/kind-action) GitHub Action to spin up a [kind](https://kind.sigs.k8s.io/) Kubernetes cluster,
and [`helm/chart-testing`](https://www.github.com/helm/chart-testing) to lint and test your charts on every pull request.

## Upgrading from v1.x.x
19 changes: 16 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
@@ -6,11 +6,24 @@ branding:
icon: anchor
inputs:
version:
description: "The chart-testing version to install (default: v3.5.1)"
description: "The chart-testing version to install (default: v3.7.0)"
required: false
default: v3.5.1
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
30 changes: 27 additions & 3 deletions ct.sh
Original file line number Diff line number Diff line change
@@ -4,7 +4,9 @@ set -o errexit
set -o nounset
set -o pipefail

DEFAULT_CHART_TESTING_VERSION=v3.5.1
DEFAULT_CHART_TESTING_VERSION=v3.7.0
DEFAULT_YAMLLINT_VERSION=1.27.1
DEFAULT_YAMALE_VERSION=3.0.4

show_help() {
cat << EOF
@@ -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 "$@"

@@ -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
;;
@@ -76,10 +100,10 @@ install_chart_testing() {
source "$venv_dir/bin/activate"

echo 'Installing yamllint...'
pip3 install yamllint==1.25.0
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