Skip to content

Commit af68300

Browse files
committed
Avoid injection
1 parent 318d9e1 commit af68300

File tree

4 files changed

+35
-22
lines changed

4 files changed

+35
-22
lines changed

check-base-images/action.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,17 @@ runs:
3434
. check-base-images/check-base-images.functions.sh
3535
popd
3636
37-
image=${{ inputs.image-name }}
38-
dockerfile=hazelcast-docker/${{ inputs.dockerfile-path }}
39-
40-
echodebug "Checking ${image}"
41-
if base_image_outdated_from_dockerfile "${image}" "${dockerfile}"; then
37+
echodebug "Checking ${IMAGE}"
38+
if base_image_outdated_from_dockerfile "${IMAGE}" "${DOCKERFILE}"; then
4239
echo "outdated=true" >> ${GITHUB_OUTPUT}
43-
echonotice "${image} needs rebuild"
44-
elif packages_updatable_from_dockerfile "${image}" "${dockerfile}"; then
40+
echonotice "${IMAGE} needs rebuild"
41+
elif packages_updatable_from_dockerfile "${IMAGE}" "${DOCKERFILE}"; then
4542
echo "outdated=true" >> ${GITHUB_OUTPUT}
46-
echonotice "System package upgrades for ${image} available"
43+
echonotice "System package upgrades for ${IMAGE} available"
4744
else
4845
echo "outdated=false" >> ${GITHUB_OUTPUT}
49-
echodebug "${image} is up-to-date"
46+
echodebug "${IMAGE} is up-to-date"
5047
fi
48+
env:
49+
IMAGE: ${{ inputs.image-name }}
50+
DOCKERFILE: hazelcast-docker/${{ inputs.dockerfile-path }}

download-hz-dist/action.yml

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ outputs:
2626
description: 'Path to the downloaded file'
2727
value: ${{ steps.derive-output-file.outputs.file }}
2828
runs:
29+
env:
30+
DISTRIBUTION: ${{ inputs.distribution }}
31+
HZ_VERSION: ${{ inputs.hz_version }}
32+
CLASSIFIER: ${{ inputs.classifier }}
33+
PACKAGING: ${{ inputs.packaging }}
2934
using: "composite"
3035
steps:
3136
- name: Get repository URL
@@ -35,34 +40,38 @@ runs:
3540
. ${GITHUB_ACTION_PATH}/../.github/scripts/logging.functions.sh
3641
3742
# Pick an appropriate key from "repo-vars-as-json"
38-
case "${{ inputs.distribution }}" in
43+
case "${DISTRIBUTION}" in
3944
"hazelcast")
40-
if [[ "${{ inputs.hz_version }}" == *"SNAPSHOT"* ]]; then
45+
if [[ "${HZ_VERSION}" == *"SNAPSHOT"* ]]; then
4146
repo_var_name=MAVEN_OSS_SNAPSHOT_REPO
4247
else
4348
repo_var_name=MAVEN_OSS_RELEASE_REPO
4449
fi
4550
;;
4651
"hazelcast-enterprise")
47-
if [[ "${{ inputs.hz_version }}" == *"SNAPSHOT"* ]]; then
52+
if [[ "${HZ_VERSION}" == *"SNAPSHOT"* ]]; then
4853
repo_var_name=MAVEN_EE_SNAPSHOT_REPO
4954
else
5055
repo_var_name=MAVEN_EE_RELEASE_REPO
5156
fi
5257
;;
5358
*)
54-
echoerr "Unsupported distribution type '${{ inputs.distribution }}'" ; return 1
59+
echoerr "Unsupported distribution type '${DISTRIBUTION}'" ; return 1
5560
;;
5661
esac
5762
5863
# Lookup up the value of the selected key in "repo-vars-as-json"
59-
echo "repo_url=$(jq --raw-output .${repo_var_name} <<< '${{ inputs.repo-vars-as-json }}')" >> ${GITHUB_OUTPUT}
64+
echo "repo_url=$(jq --raw-output .${repo_var_name} <<< '${REPO_VARS_AS_JSON}')" >> ${GITHUB_OUTPUT}
65+
env:
66+
REPO_VARS_AS_JSON: ${{ inputs.repo-vars-as-json }}
6067

6168
- name: Derive output file
6269
id: derive-output-file
6370
shell: bash
6471
run: |
65-
echo "file=${{ inputs.output_file || format('distribution.{0}', inputs.packaging) }}" >> ${GITHUB_OUTPUT}
72+
echo "file=${FILE}" >> ${GITHUB_OUTPUT}
73+
env:
74+
FILE: ${{ inputs.output_file || format('distribution.{0}', inputs.packaging) }}
6675

6776
- name: Download via Maven
6877
shell: bash
@@ -71,10 +80,10 @@ runs:
7180
org.apache.maven.plugins:maven-dependency-plugin:2.10:get \
7281
-DremoteRepositories="${{ steps.get_repo_url.outputs.repo_url }}" \
7382
-DgroupId="com.hazelcast" \
74-
-DartifactId="${{ inputs.distribution }}-distribution" \
75-
-Dversion="${{ inputs.hz_version }}" \
76-
-Dclassifier="${{ inputs.classifier }}" \
77-
-Dpackaging="${{ inputs.packaging }}" \
83+
-DartifactId="${DISTRIBUTION}-distribution" \
84+
-Dversion="${HZ_VERSION}" \
85+
-Dclassifier="${CLASSIFIER}" \
86+
-Dpackaging="${PACKAGING}" \
7887
-Dtransitive=false \
7988
-Ddest="${{ steps.derive-output-file.outputs.file }}" \
8089
--batch-mode \

get-supported-jdks/action.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ runs:
1818
id: get-supported-jdks
1919
run: |
2020
source ${GITHUB_ACTION_PATH}/get-supported-jdks.functions.sh
21-
echo "jdks=$(get_supported_jdks ${{ inputs.HZ_VERSION}} )" >> ${GITHUB_OUTPUT}
21+
echo "jdks=$(get_supported_jdks ${HZ_VERSION} )" >> ${GITHUB_OUTPUT}
22+
with:
23+
HZ_VERSION: ${{ inputs.HZ_VERSION}}
2224

2325
- shell: bash
2426
id: get-default-jdk

resolve-editions/action.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,7 @@ runs:
2121
run: |
2222
source ${GITHUB_ACTION_PATH}/build.functions.sh
2323
24-
echo "should_build_oss=$(should_build_oss "${{ inputs.release-type }}")" >> ${GITHUB_OUTPUT}
25-
echo "should_build_ee=$(should_build_ee "${{ inputs.release-type }}")" >> ${GITHUB_OUTPUT}
24+
echo "should_build_oss=$(should_build_oss "${RELEASE_TYPE}")" >> ${GITHUB_OUTPUT}
25+
echo "should_build_ee=$(should_build_ee "${RELEASE_TYPE}")" >> ${GITHUB_OUTPUT}
26+
env:
27+
RELEASE_TYPE: ${{ inputs.release-type }}

0 commit comments

Comments
 (0)