Skip to content

Update Jaeger Version #13

Update Jaeger Version

Update Jaeger Version #13

name: Update Jaeger Version
on:
schedule:
# Runs once a week on Monday at 00:00 UTC
- cron: '0 0 * * 1'
workflow_dispatch:
inputs:
dry_run:
description: 'Dry run mode - skip PR creation and only print status'
required: false
default: 'false'
type: boolean
jobs:
update-jaeger-version:
runs-on: ubuntu-latest
permissions:
contents: read
env:
# Use the dry_run input if it exists (workflow_dispatch).
# Otherwise, if the event is 'schedule' (or anything else), default to 'false'.
DRY_RUN: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run || 'false' }}
steps:
- name: ⬇️ Checkout repository
uses: actions/checkout@v6
with:
# Use the bot's PAT instead of the default GITHUB_TOKEN
token: ${{ secrets.JAEGERTRACINGBOT_PAT }}
ref: main
- name: 🔍 Check for new Jaeger version
run: bash ./.github/scripts/update-jaeger-version.sh
- name: ⚙️ Configure Git
if: ${{ env.DRY_RUN != 'true' }}
run: |
git config user.name "jaegertracingbot"
git config user.email "[email protected]"
- name: 📝 Commit changes
if: ${{ env.DRY_RUN != 'true' }}
id: commit
run: |
CHART_PATH="charts/jaeger/Chart.yaml"
# Check if any changes exist before committing
if git diff --exit-code "$CHART_PATH"; then
echo "No changes to commit. Exiting."
echo "pr_needed=false" >> $GITHUB_OUTPUT
else
# Extract versions from Chart.yaml for commit message and PR
NEW_APP_VERSION=$(grep '^appVersion:' "$CHART_PATH" | sed 's/appVersion: *//' | tr -d '"')
git add "$CHART_PATH"
git commit -sm "chore(deps): Bump Jaeger to ${NEW_APP_VERSION}"
# Create and switch to a new topic branch for the PR
NEW_BRANCH="bot/update-jaeger-${NEW_APP_VERSION}"
git checkout -b "$NEW_BRANCH"
echo "pr_needed=true" >> $GITHUB_OUTPUT
echo "branch_name=${NEW_BRANCH}" >> $GITHUB_OUTPUT
echo "new_app_version=${NEW_APP_VERSION}" >> $GITHUB_OUTPUT
fi
- name: 🚀 Push new branch
if: ${{ steps.commit.outputs.pr_needed == 'true' && env.DRY_RUN != 'true' }}
run: |
git push origin HEAD:${{ steps.commit.outputs.branch_name }}
- name: ✨ Create Pull Request
if: ${{ steps.commit.outputs.pr_needed == 'true' && env.DRY_RUN != 'true' }}
env:
GH_TOKEN: ${{ secrets.JAEGERTRACINGBOT_PAT }}
run: |
gh pr create \
--title "chore(deps): Bump Jaeger to ${{ steps.commit.outputs.new_app_version }}" \
--body "This PR was automatically generated to update the Jaeger Helm chart to version \`${{ steps.commit.outputs.new_app_version }}\`.
## Source
Docker Hub image: [jaegertracing/jaeger](https://hub.docker.com/r/jaegertracing/jaeger)" \
--base main \
--head ${{ steps.commit.outputs.branch_name }}