Skip to content

Dockerfile: Bump golang from fcdb3e4 to 5f3787b in /auth-service #502

Dockerfile: Bump golang from fcdb3e4 to 5f3787b in /auth-service

Dockerfile: Bump golang from fcdb3e4 to 5f3787b in /auth-service #502

Workflow file for this run

# SPDX-FileCopyrightText: 2026 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
---
name: Auto Bump Chart Version
on:
pull_request:
types: [opened, synchronize]
paths:
- 'charts/**'
- 'keycloak-tenant-controller/**'
- 'squid-proxy/**'
- 'cert-synchronizer/**'
- 'aws-sm-proxy/**'
- 'auth-service/**'
permissions: read-all
jobs:
bump-app:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
with:
token: ${{ secrets.PAT_TOKEN || secrets.GITHUB_TOKEN }}
ref: ${{ github.head_ref }}
fetch-depth: 0 # Needed to get diff info
- name: Install yq
run: |
sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
sudo chmod +x /usr/local/bin/yq
- name: Get changed app directories
id: changed-apps
env:
BASE_REF: ${{ github.base_ref }}
run: |
# Get the base branch for comparison
git fetch origin ${BASE_REF}
# Find all files that have been modified
changed_files=$(git diff --name-only origin/${BASE_REF}...HEAD)
# Check for specific app directory changes
changed_apps=""
# Check keycloak-tenant-controller
if echo "$changed_files" | grep -q "^keycloak-tenant-controller/"; then
changed_apps="$changed_apps keycloak-tenant-controller"
echo "Found changes in keycloak-tenant-controller"
fi
# Check squid-proxy
if echo "$changed_files" | grep -q "^squid-proxy/"; then
changed_apps="$changed_apps squid-proxy"
echo "Found changes in squid-proxy"
fi
# Check cert-synchronizer
if echo "$changed_files" | grep -q "^cert-synchronizer/"; then
changed_apps="$changed_apps cert-synchronizer"
echo "Found changes in cert-synchronizer"
fi
# Check aws-sm-proxy
if echo "$changed_files" | grep -q "^aws-sm-proxy/"; then
changed_apps="$changed_apps aws-sm-proxy"
echo "Found changes in aws-sm-proxy"
fi
# Check auth-service
if echo "$changed_files" | grep -q "^auth-service/"; then
changed_apps="$changed_apps auth-service"
echo "Found changes in auth-service"
fi
echo "changed_apps=$changed_apps" >> $GITHUB_OUTPUT
- name: Bump App Versions
if: steps.changed-apps.outputs.changed_apps != ''
env:
BASE_REF: ${{ github.base_ref }}
BRANCH_NAME: ${{ github.head_ref }}
run: |
changed_apps="${{ steps.changed-apps.outputs.changed_apps }}"
updated_apps=""
for app_name in $changed_apps; do
CHART_FILE="charts/$app_name/Chart.yaml"
if [ -f "$CHART_FILE" ]; then
current_app_version=$(yq eval '.appVersion' "$CHART_FILE")
current_chart_version=$(yq eval '.version' "$CHART_FILE")
# Get base versions to compare
base_app_version=$(git show origin/${BASE_REF}:${CHART_FILE} 2>/dev/null | yq eval '.appVersion' - || echo "")
base_chart_version=$(git show origin/${BASE_REF}:${CHART_FILE} 2>/dev/null | yq eval '.version' - || echo "")
# Only bump if versions haven't been changed from base
if [ "$current_app_version" = "$base_app_version" ] && [ "$current_chart_version" = "$base_chart_version" ]; then
# Simple patch version bump for appVersion
IFS='.' read -ra VERSION_PARTS <<< "$current_app_version"
major=${VERSION_PARTS[0]}
minor=${VERSION_PARTS[1]}
patch=${VERSION_PARTS[2]}
new_patch=$((patch + 1))
new_app_version="${major}.${minor}.${new_patch}"
# Simple patch version bump for chart version
IFS='.' read -ra CHART_VERSION_PARTS <<< "$current_chart_version"
chart_major=${CHART_VERSION_PARTS[0]}
chart_minor=${CHART_VERSION_PARTS[1]}
chart_patch=${CHART_VERSION_PARTS[2]}
new_chart_patch=$((chart_patch + 1))
new_chart_version="${chart_major}.${chart_minor}.${new_chart_patch}"
echo "Bumping $app_name appVersion from $current_app_version to $new_app_version"
echo "Bumping $app_name chart version from $current_chart_version to $new_chart_version"
yq eval ".appVersion = \"$new_app_version\"" -i "$CHART_FILE"
yq eval ".version = \"$new_chart_version\"" -i "$CHART_FILE"
updated_apps="$updated_apps $app_name"
else
echo "Skipping $app_name - versions already bumped in this PR"
fi
fi
done
# Check if there are changes to commit
if git diff --quiet charts/; then
echo "No app version changes to commit"
exit 0
fi
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add charts/
# Create commit message with all updated apps
if [ -n "$updated_apps" ]; then
commit_msg="chore: bump app and chart versions for:$updated_apps"
git commit -m "$commit_msg"
git push origin $BRANCH_NAME
fi
bump-chart:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
with:
token: ${{ secrets.PAT_TOKEN || secrets.GITHUB_TOKEN }}
ref: ${{ github.head_ref }}
fetch-depth: 0 # Needed to get diff info
- name: Install yq
run: |
sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
sudo chmod +x /usr/local/bin/yq
- name: Get changed charts
id: changed-charts
env:
BASE_REF: ${{ github.base_ref }}
run: |
# Get the base branch for comparison
git fetch origin ${BASE_REF}
# Find all Chart.yaml files that have been modified or are in modified directories
changed_files=$(git diff --name-only origin/${BASE_REF}...HEAD)
# Find chart directories that contain changes
changed_charts=""
for chart_dir in charts/*/; do
if [ -d "$chart_dir" ] && [ -f "${chart_dir}Chart.yaml" ]; then
chart_name=$(basename "$chart_dir")
# Check if any files in this chart directory have been modified
if echo "$changed_files" | grep -q "^${chart_dir}"; then
# Check if version was already changed in the PR
chart_file="${chart_dir}Chart.yaml"
version_already_changed=false
if echo "$changed_files" | grep -q "^$chart_file$"; then
# Check if version field was actually changed
version_diff=$(git diff origin/${BASE_REF}...HEAD -- "$chart_file" | grep -E "^\+.*version:" || true)
if [ -n "$version_diff" ]; then
version_already_changed=true
echo "Version already bumped for chart: $chart_name"
fi
fi
if [ "$version_already_changed" = false ]; then
changed_charts="$changed_charts $chart_name"
echo "Found changes in chart: $chart_name (version not yet bumped)"
fi
fi
fi
done
echo "changed_charts=$changed_charts" >> $GITHUB_OUTPUT
- name: Bump Chart Versions
if: steps.changed-charts.outputs.changed_charts != ''
env:
BASE_REF: ${{ github.base_ref }}
BRANCH_NAME: ${{ github.head_ref }}
run: |
changed_charts="${{ steps.changed-charts.outputs.changed_charts }}"
updated_charts=""
for chart_name in $changed_charts; do
CHART_FILE="charts/$chart_name/Chart.yaml"
if [ -f "$CHART_FILE" ]; then
current_version=$(yq eval '.version' "$CHART_FILE")
# Get base version to compare
base_version=$(git show origin/${BASE_REF}:${CHART_FILE} 2>/dev/null | yq eval '.version' - || echo "")
# Only bump if version hasn't been changed from base
if [ "$current_version" = "$base_version" ]; then
# Simple patch version bump
IFS='.' read -ra VERSION_PARTS <<< "$current_version"
major=${VERSION_PARTS[0]}
minor=${VERSION_PARTS[1]}
patch=${VERSION_PARTS[2]}
new_patch=$((patch + 1))
new_version="${major}.${minor}.${new_patch}"
echo "Bumping $chart_name version from $current_version to $new_version"
yq eval ".version = \"$new_version\"" -i "$CHART_FILE"
updated_charts="$updated_charts $chart_name"
else
echo "Skipping $chart_name - version already bumped in this PR"
fi
fi
done
# Check if there are changes to commit
if git diff --quiet charts/; then
echo "No version changes to commit"
exit 0
fi
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add charts/
# Create commit message with all updated charts
if [ -n "$updated_charts" ]; then
commit_msg="chore: bump chart versions for:$updated_charts"
git commit -m "$commit_msg"
git push origin $BRANCH_NAME
fi