-
Notifications
You must be signed in to change notification settings - Fork 65
OSAC-2185: Gate chart publish on image build success #81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
openshift-merge-bot
merged 5 commits into
osac-project:main
from
minmzzhang:OSAC-2185-gate-chart-publish-on-image-build
Jul 20, 2026
+93
−14
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
f21dad8
OSAC-2185: gate publish-charts on image build success via workflow_run
minmzzhang 1aed9cd
OSAC-2185: address CodeRabbit review feedback
minmzzhang c0f34b3
OSAC-2185: address round 2 of CodeRabbit review feedback
minmzzhang c0c5e30
OSAC-2185: address round 3 of CodeRabbit review feedback
minmzzhang 9ed2244
OSAC-2185: address round 4 of CodeRabbit review feedback
minmzzhang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| #!/usr/bin/env bash | ||
| # Verifies that a git tag still resolves to the guarded commit SHA that was | ||
| # validated by this workflow's guard job, protecting against a force-push/ | ||
| # retag race between the image build and any subsequent chart-publish or | ||
| # release step. | ||
| # | ||
| # Required env vars: GH_TOKEN, REPO, TAG, GUARDED_SHA | ||
| set -euo pipefail | ||
|
|
||
| ref_json="$(gh api "repos/${REPO}/git/ref/tags/${TAG}" --jq '[.object.type, .object.sha] | @tsv')" | ||
| read -r current_type current_sha <<< "$ref_json" | ||
| if [[ "$current_type" == "tag" ]]; then | ||
| # Annotated tag: the ref's object.sha is the tag object, not the commit - peel it. | ||
| current_sha="$(gh api "repos/${REPO}/git/tags/${current_sha}" --jq .object.sha)" | ||
| fi | ||
|
|
||
| if [[ "$current_sha" != "$GUARDED_SHA" ]]; then | ||
| echo "::error::Tag '${TAG}' now points at ${current_sha}, not the guarded commit ${GUARDED_SHA} (force-pushed?). Refusing to proceed." | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "Tag '${TAG}' still points at the guarded commit ${GUARDED_SHA}." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.