switch cosign registry from GCR to GHCR #67
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 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@d632683dd7b4114ad314bca15554477dd762a938 | |
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 }} |