Validate Helm chart #1
Workflow file for this run
This file contains 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
name: Validate published Cilium Helm chart | |
on: | |
pull_request: {} | |
push: | |
branches: | |
- master | |
jobs: | |
pull-and-validate: | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b | |
with: | |
fetch-depth: 0 | |
persist-credentials: false | |
- name: Set up job variables | |
id: vars | |
run: | | |
# Get last commit message | |
readonly local last_commit_log=$(git log -1 --grep "^Add cilium" --pretty=format:"%s") | |
echo "last commit log: $last_commit_log" | |
readonly local chart_version=$(echo "$last_commit_log" | grep -Eo "Add cilium v[^@]+" | sed 's/Add\ cilium\ v//' ) | |
echo "Helm chart detected version: '${chart_version}'" | |
if [[ -n "${chart_version}" ]]; then | |
echo ::set-output name=chartVersion::${chart_version} | |
fi | |
- name: Validate Helm chart | |
if: steps.vars.output.chartVersion != '' | |
run: | | |
helm repo add cilium https://helm.cilium.io | |
helm repo update | |
until helm pull cilium/cilium -d /tmp --version ${{ steps.vars.outputs.chartVersion }} | |
do | |
echo "helm pull failed. Retrying..." | |
sleep 1 | |
done | |
./validate-cilium-chart.sh /tmp/cilium-${{ steps.vars.outputs.chartVersion }}.tgz |