Skip to content

Commit 84169ad

Browse files
committed
fix(workflows): address Copilot review round 9 comments
- shared-release: append '|| true' to grep pipeline in command substitution so pipefail does not swallow the explicit parse-error message when VERSION is not found - shared-go-build: add early Validate inputs step that rejects push=true with docker-build=false to prevent unnecessary packages:write token scope being granted without Docker steps running Signed-off-by: I313226 <onur.yilmaz@sap.com>
1 parent cc53b89 commit 84169ad

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

.github/workflows/shared-go-build.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ jobs:
5656
- name: Checkout repository
5757
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
5858

59+
- name: Validate inputs
60+
run: |
61+
if [ "${{ inputs.push }}" = "true" ] && [ "${{ inputs.docker-build }}" != "true" ]; then
62+
echo "ERROR: push=true requires docker-build=true"
63+
exit 1
64+
fi
65+
5966
- name: Set up Go
6067
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5
6168
with:

.github/workflows/shared-release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686
- name: Compute new version
8787
id: version
8888
run: |
89-
CURRENT_VERSION=$(grep -E '^VERSION[[:space:]]*[:?]?=' "${{ inputs.makefile-path }}" | head -1 | sed 's/.*=[[:space:]]*//' | tr -d '[:space:]')
89+
CURRENT_VERSION=$(grep -E '^VERSION[[:space:]]*[:?]?=' "${{ inputs.makefile-path }}" | head -1 | sed 's/.*=[[:space:]]*//' | tr -d '[:space:]' || true)
9090
echo "Current version: $CURRENT_VERSION"
9191
9292
if ! echo "$CURRENT_VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+$'; then

0 commit comments

Comments
 (0)