From 5823944a1e279bc297eb544b450cb1de66fb2c36 Mon Sep 17 00:00:00 2001 From: Armel Soro Date: Fri, 19 Jun 2026 13:41:00 +0200 Subject: [PATCH] fix(ci): fall back to rhdh-hub-rhel9 when next-1.y tag expires The next-1.y tags on quay.io/rhdh-community/rhdh can expire, causing the nightly workflow to fail for older release branches. Use skopeo to check if the tag exists at runtime. If it has expired, fall back to quay.io/rhdh/rhdh-hub-rhel9:1.y instead. --- .github/workflows/nightly.yaml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index fc3985ed..93269243 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -69,15 +69,24 @@ jobs: echo "exists=false" >> "$GITHUB_OUTPUT" fi - - name: Compute image tag + - name: Compute image repo and tag if: steps.check.outputs.exists == 'true' id: image run: | if [[ "${{ matrix.branch }}" == "main" ]]; then + echo "repo=rhdh-community/rhdh" >> "$GITHUB_OUTPUT" echo "tag=next" >> "$GITHUB_OUTPUT" else - # release-x.y -> next-x.y - echo "tag=next-${BRANCH#release-}" >> "$GITHUB_OUTPUT" + version="${BRANCH#release-}" + candidate_tag="next-${version}" + if skopeo inspect --no-tags "docker://quay.io/rhdh-community/rhdh:${candidate_tag}" &>/dev/null; then + echo "repo=rhdh-community/rhdh" >> "$GITHUB_OUTPUT" + echo "tag=${candidate_tag}" >> "$GITHUB_OUTPUT" + else + echo "::warning::Tag ${candidate_tag} not found on quay.io/rhdh-community/rhdh, falling back to quay.io/rhdh/rhdh-hub-rhel9:${version}" + echo "repo=rhdh/rhdh-hub-rhel9" >> "$GITHUB_OUTPUT" + echo "tag=${version}" >> "$GITHUB_OUTPUT" + fi fi env: BRANCH: ${{ matrix.branch }} @@ -107,4 +116,4 @@ jobs: chart: charts/${{ matrix.chart }} all_charts: 'true' monitoring_heartbeat: ${{ vars.TEST_MONITORING_HEARTBEAT_ENABLED || 'false' }} - extra_helm_args: ${{ matrix.chart == 'backstage' && format('--set upstream.backstage.image.repository=rhdh-community/rhdh --set upstream.backstage.image.tag={0} --set upstream.backstage.image.pullPolicy=Always', steps.image.outputs.tag) || '' }} + extra_helm_args: ${{ matrix.chart == 'backstage' && format('--set upstream.backstage.image.repository={0} --set upstream.backstage.image.tag={1} --set upstream.backstage.image.pullPolicy=Always', steps.image.outputs.repo, steps.image.outputs.tag) || '' }}