Skip to content

chore(deps): update tombi-toml/setup-tombi digest to 0ca8607 (release-1.9) #6483

chore(deps): update tombi-toml/setup-tombi digest to 0ca8607 (release-1.9)

chore(deps): update tombi-toml/setup-tombi digest to 0ca8607 (release-1.9) #6483

name: PR Bundle Manifests Validator
on:
pull_request:
types: [opened, synchronize, reopened]
branches:
- main
- release-1.[0-9]+
concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}
cancel-in-progress: true
jobs:
check-bundle:
name: Validate Bundle Manifests
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
contents: write
steps:
- name: Checkout PR branch
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.head_ref }}
persist-credentials: false
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6
with:
go-version-file: 'go.mod'
- name: Regenerate bundle manifests
run: make bundles build-installers
- name: Check for changes
id: check
run: |
# Since operator-sdk 1.26.0, `make bundle` changes the `createdAt` field from the bundle every time we run it.
# The `git diff` below checks if only the createdAt field has changed. If it is the only change, it is ignored.
# Inspired from https://github.com/operator-framework/operator-sdk/issues/6285#issuecomment-1415350333
if git diff --quiet -I'^ createdAt: ' bundle config dist; then
echo "✅ Bundle manifests are up to date"
echo "changed=false" >> "$GITHUB_OUTPUT"
else
echo "Bundle manifests are out of sync"
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Auto-commit and push updated bundle manifests
id: autopush
# Only attempt on same-repo PRs (not forks) for security; best-effort — failure falls through to the next step
if: steps.check.outputs.changed == 'true' && github.event.pull_request.head.repo.full_name == github.repository
continue-on-error: true
env:
RHDH_BOT_TOKEN: ${{ secrets.RHDH_BOT_TOKEN }}
HEAD_REF: ${{ github.head_ref }}
run: |
if [[ -z "${RHDH_BOT_TOKEN}" || -z "${HEAD_REF}" ]]; then
echo "::warning::RHDH_BOT_TOKEN or HEAD_REF is not set, skipping auto-push"
exit 0
fi
git config user.name "rhdh-bot"
git config user.email "rhdh-bot@redhat.com"
git remote set-url origin "https://x-access-token:${RHDH_BOT_TOKEN}@github.com/${{ github.repository }}.git"
git add bundle/ config/ dist/
git commit -m "chore: regenerate bundle manifests"
if git push origin "HEAD:${HEAD_REF}"; then
echo "pushed=true" >> "$GITHUB_OUTPUT"
else
echo "pushed=false" >> "$GITHUB_OUTPUT"
git reset --mixed HEAD~1
fi
- name: Fail if bundle manifests are out of sync
if: steps.check.outputs.changed == 'true' && steps.autopush.outputs.pushed != 'true'
run: |
echo "::error::Bundle manifests are out of sync with the code"
echo ""
echo "❌ The bundle manifests need to be regenerated."
echo ""
echo "This usually happens when you modify:"
echo " - CRD definitions (api/)"
echo " - Operator manifests (config/manifests/)"
echo " - RBAC permissions (config/rbac/)"
echo " - Webhook configurations (config/webhook/)"
echo ""
echo "To fix this, run:"
echo " make bundles build-installers"
echo " git add bundle/ config/ dist/"
echo " git commit -m 'chore: regenerate bundle manifests'"
echo " git push"
echo ""
echo "Changed files:"
git diff --name-only -I'^ createdAt: ' bundle config dist
exit 1