Skip to content

Add cilium v1.16.3@f221719170636b0e0da2c7b8227c18967a1201c8 ⎈ #78

Add cilium v1.16.3@f221719170636b0e0da2c7b8227c18967a1201c8 ⎈

Add cilium v1.16.3@f221719170636b0e0da2c7b8227c18967a1201c8 ⎈ #78

name: Validate Cilium Helm chart
on:
pull_request: {}
push:
branches:
- master
jobs:
validate:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout code
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871
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
if [ "${{ github.event_name }}" = "pull_request" ] ; then
# Use the local chart file for pull requests.
echo "chartPath=cilium-${chart_version}.tgz" >> $GITHUB_OUTPUT
else
# Download the chart from the Helm repository on push.
helm repo add cilium https://helm.cilium.io
helm repo update
mkdir tmp
until helm pull cilium/cilium -d tmp --version "${chart_version}"
do
echo "helm pull failed. Retrying..."
sleep 1
helm repo update
done
echo "chartPath=tmp/cilium-${chart_version}.tgz" >> $GITHUB_OUTPUT
fi
fi
- name: Validate Helm chart
if: ${{ steps.vars.outputs.chartPath != '' }}
run: |
./validate_helm_chart.sh ${{ steps.vars.outputs.chartPath }}