Skip to content
This repository has been archived by the owner on Apr 9, 2023. It is now read-only.

Commit

Permalink
Merge pull request #50 from stefanprodan/pin-yq
Browse files Browse the repository at this point in the history
Add yq version to the action args
  • Loading branch information
stefanprodan authored Dec 16, 2021
2 parents 792b524 + 5ccb119 commit f07f65e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ inputs:
description: 'conftest version'
kubeconform:
description: 'kubeconform version'
yq:
description: 'yq version'
runs:
using: 'docker'
image: 'Dockerfile'
Expand All @@ -39,3 +41,4 @@ runs:
- ${{ inputs.kubeval }}
- ${{ inputs.conftest }}
- ${{ inputs.kubeconform }}
- ${{ inputs.yq }}
22 changes: 14 additions & 8 deletions src/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,54 +3,60 @@
set -e
set -o pipefail

KUBECTL_VER=$2
KUBECTL_VER=${2}
if [[ "${KUBECTL_VER}" != "" ]]; then
curl -sL https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VER}/bin/linux/amd64/kubectl \
-o /usr/local/bin/kubectl && chmod +x /usr/local/bin/kubectl
fi

KUSTOMIZE_VER=$3
KUSTOMIZE_VER=${3}
if [[ "${KUSTOMIZE_VER}" != "" ]]; then
curl -sL https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv${KUSTOMIZE_VER}/kustomize_v${KUSTOMIZE_VER}_linux_amd64.tar.gz | \
tar xz && mv kustomize /usr/local/bin/kustomize
fi

HELM_VER=$4
HELM_VER=${4}
if [[ "${HELM_VER}" != "" ]]; then
curl -sL https://get.helm.sh/helm-v${HELM_VER}-linux-amd64.tar.gz | \
tar xz && mv linux-amd64/helm /usr/local/bin/helm && rm -rf linux-amd64
fi

HELM3_VER=$5
HELM3_VER=${5}
if [[ "${HELM3_VER}" != "" ]]; then
curl -sL https://get.helm.sh/helm-v${HELM3_VER}-linux-amd64.tar.gz | \
tar xz && mv linux-amd64/helm /usr/local/bin/helmv3 && rm -rf linux-amd64
fi

KUBESEAL_VER=$6
KUBESEAL_VER=${6}
if [[ "${KUBESEAL_VER}" != "" ]]; then
curl -sL https://github.com/bitnami-labs/sealed-secrets/releases/download/v${KUBESEAL_VER}/kubeseal-linux-amd64 \
-o /usr/local/bin/kubeseal && chmod +x /usr/local/bin/kubeseal
fi

KUBEVAL_VER=$7
KUBEVAL_VER=${7}
if [[ "${KUBEVAL_VER}" != "" ]]; then
curl -sL https://github.com/instrumenta/kubeval/releases/download/${KUBEVAL_VER}/kubeval-linux-amd64.tar.gz | \
tar xz && mv kubeval /usr/local/bin/kubeval
fi

CONFTEST_VER=$8
CONFTEST_VER=${8}
if [[ "${CONFTEST_VER}" != "" ]]; then
wget -O conftest https://github.com/open-policy-agent/conftest/releases/download/v${CONFTEST_VER}/conftest_${CONFTEST_VER}_Linux_x86_64.tar.gz -q
tar xzf conftest && mv conftest /usr/local/bin
fi

KUBECONFORM_VER=$9
KUBECONFORM_VER=${9}
if [[ "${KUBECONFORM_VER}" != "" ]]; then
curl -sSL https://github.com/yannh/kubeconform/releases/download/v${KUBECONFORM_VER}/kubeconform-linux-amd64.tar.gz | \
tar xz && mv kubeconform /usr/local/bin/kubeconform
fi

YQ_VER=${10}
if [[ "${YQ_VER}" != "" ]]; then
curl -sL https://github.com/mikefarah/yq/releases/download/v${YQ_VER}/yq_linux_amd64 \
-o /usr/local/bin/yq && chmod +x /usr/local/bin/yq
fi

echo ">>> Executing command <<<"
echo ""
echo ""
Expand Down
3 changes: 2 additions & 1 deletion src/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ curl -sSL https://github.com/yannh/kubeconform/releases/download/v${KUBECONFORM}
tar xz && mv kubeconform /usr/local/bin/kubeconform
kubeconform --help

YQ=4.16.1
echo "downloading yq"
curl -sL https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 \
curl -sL https://github.com/mikefarah/yq/releases/download/v${YQ}/yq_linux_amd64 \
-o /usr/local/bin/yq && chmod +x /usr/local/bin/yq
yq --version

Expand Down

0 comments on commit f07f65e

Please sign in to comment.