This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 7b2268a19d7c ci: pass workflow inputs and base_ref through env, not
into run text (#31071)
7b2268a19d7c is described below
commit 7b2268a19d7c5d7227254e8a0a8dc6e27bc985dc
Author: dhairya05 <[email protected]>
AuthorDate: Mon Nov 30 14:02:35 2026 +0530
ci: pass workflow inputs and base_ref through env, not into run text
(#31071)
GitHub expands ${{ }} textually before bash parses a run: block, so a value
containing shell metacharacters becomes script rather than data; the quotes
around it are already part of the text by then. Three expressions are
expanded that way:
- check-container-versions.yml: github.event.inputs.scan_path
- check-container-versions.yml: github.event.inputs.check_prereleases
- camel-launcher-native-exe.yml: github.base_ref
Bind each to env: on its step and read it as a shell variable instead.
The scheduled run of check-container-versions is unchanged:
github.event.inputs.* is empty there, and ${SCAN_PATH_INPUT:-test-infra}
yields the same test-infra default that the || 'test-infra' did.
Neither of these is a demonstrated hole -- workflow_dispatch already needs
write access, and base_ref is a branch of this repository -- but zizmor
reports all three as high-confidence template-injection, and they are cheap
to close.
github.event_name, github.event.before and github.sha in the same block are
left as they are: zizmor does not flag them, and changing them would be
churn.
Co-Authored-By: Claude <[email protected]>
---
.github/workflows/camel-launcher-native-exe.yml | 4 +++-
.github/workflows/check-container-versions.yml | 7 +++++--
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/camel-launcher-native-exe.yml
b/.github/workflows/camel-launcher-native-exe.yml
index 3b81e9d4468b..23eb7097301b 100644
--- a/.github/workflows/camel-launcher-native-exe.yml
+++ b/.github/workflows/camel-launcher-native-exe.yml
@@ -59,6 +59,8 @@ jobs:
persist-credentials: false
fetch-depth: 0
- id: changes
+ env:
+ BASE_REF: ${{ github.base_ref }}
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "camel-exe=true" >> "$GITHUB_OUTPUT"
@@ -68,7 +70,7 @@ jobs:
fi
if [ "${{ github.event_name }}" = "pull_request" ]; then
- CHANGED="$(git diff --name-only "origin/${{ github.base_ref
}}"...HEAD)"
+ CHANGED="$(git diff --name-only "origin/$BASE_REF"...HEAD)"
else
CHANGED="$(git diff --name-only "${{ github.event.before }}" "${{
github.sha }}")"
fi
diff --git a/.github/workflows/check-container-versions.yml
b/.github/workflows/check-container-versions.yml
index 476b4c2bdc32..c276503b8901 100644
--- a/.github/workflows/check-container-versions.yml
+++ b/.github/workflows/check-container-versions.yml
@@ -58,11 +58,14 @@ jobs:
- name: Check container versions
id: version_check
+ env:
+ SCAN_PATH_INPUT: ${{ github.event.inputs.scan_path }}
+ CHECK_PRERELEASES: ${{ github.event.inputs.check_prereleases }}
run: |
- SCAN_PATH="${{ github.event.inputs.scan_path || 'test-infra' }}"
+ SCAN_PATH="${SCAN_PATH_INPUT:-test-infra}"
PRERELEASE_FLAG=""
- if [[ "${{ github.event.inputs.check_prereleases }}" == "true" ]];
then
+ if [[ "$CHECK_PRERELEASES" == "true" ]]; then
PRERELEASE_FLAG="--check-prereleases"
fi