Skip to content

Commit 5964095

Browse files
ckhordiasmaclaude
andcommitted
add dry_run input to push results to a dummy branch
When dry_run is checked, results are pushed to BRANCH-dry-run instead of the actual branch, allowing safe testing without modifying release branches. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 7eaa333 commit 5964095

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

.github/workflows/process-operator-bundle.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ on:
77
description: 'RHOAI version to process (e.g. rhoai-3.5, rhoai-3.5-ea.2). Branch name used if omitted.'
88
required: false
99
type: string
10+
dry_run:
11+
description: 'Push results to BRANCH-dry-run instead of the actual branch.'
12+
required: false
13+
type: boolean
14+
default: false
1015
push:
1116
paths:
1217
- bundle/additional-images-patch.yaml
@@ -160,6 +165,8 @@ jobs:
160165
git config user.name "Openshift-AI DevOps"
161166
git config user.email "openshift-ai-devops@redhat.com"
162167
git add -A
168+
PUSH_BRANCH="${{ inputs.dry_run == true && format('{0}-dry-run-bundle', steps.get_branch.outputs.branch) || steps.get_branch.outputs.branch }}"
169+
FORCE_FLAG="${{ inputs.dry_run == true && '--force' || '' }}"
163170
git diff --staged --quiet || (git commit -m "Updating the bundle-csv and helm chart values with latest images
164171
165-
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" && git push origin ${{ steps.get_branch.outputs.branch }})
172+
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" && git push ${FORCE_FLAG} origin HEAD:${PUSH_BRANCH})

.github/workflows/trigger-nightly-bundle-build.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ on:
77
description: 'RHOAI version to process (e.g. rhoai-3.5, rhoai-3.5-ea.2). Branch name used if omitted.'
88
required: false
99
type: string
10+
dry_run:
11+
description: 'Push results to BRANCH-dry-run instead of the actual branch.'
12+
required: false
13+
type: boolean
14+
default: false
1015
push:
1116
paths:
1217
- schedule/bundle-github-trigger.txt
@@ -150,6 +155,8 @@ jobs:
150155
git config user.name "Openshift-AI DevOps"
151156
git config user.email "openshift-ai-devops@redhat.com"
152157
git add -A
158+
PUSH_BRANCH="${{ inputs.dry_run == true && format('{0}-dry-run-nightly-bundle', steps.get_branch.outputs.branch) || steps.get_branch.outputs.branch }}"
159+
FORCE_FLAG="${{ inputs.dry_run == true && '--force' || '' }}"
153160
git diff --staged --quiet || (git commit -m "Updating the bundle-csv and helm chart values with latest images
154161
155-
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" && git push origin ${{ steps.get_branch.outputs.branch }})
162+
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" && git push ${FORCE_FLAG} origin HEAD:${PUSH_BRANCH})

0 commit comments

Comments
 (0)