Skip to content

Commit 31be70f

Browse files
authored
ci: fix semgrep reported run-shell-injection (#764)
1 parent 73eba81 commit 31be70f

File tree

3 files changed

+19
-8
lines changed

3 files changed

+19
-8
lines changed

.github/workflows/gradle-goal/action.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,7 @@ runs:
2929
java-version-file: ${{ inputs.java-version-file }}
3030
distribution: ${{ inputs.distribution }}
3131
cache: 'gradle'
32-
- run: ${{ inputs.command }}
32+
- run: "${COMMAND}"
3333
shell: ${{ inputs.shell }}
34+
env:
35+
COMMAND: ${{ inputs.command }}

.github/workflows/pre-post-release.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,13 @@ jobs:
106106
- name: Insert notes into cumulative changelog (post release)
107107
if: inputs.phase == 'post'
108108
run: |
109-
echo "# ${{ inputs.version }} - $(date +'%d/%m/%Y')" > tmpchangelog
110-
echo '${{ inputs.changelog }}' >> tmpchangelog
109+
echo "# ${VERSION} - $(date +'%d/%m/%Y')" > tmpchangelog
110+
echo "${CHANGELOG}" >> tmpchangelog
111111
cat CHANGELOG.md >> tmpchangelog
112112
mv tmpchangelog CHANGELOG.md
113+
env:
114+
VERSION: ${{ inputs.version }}
115+
CHANGELOG: ${{ inputs.changelog }}
113116

114117
- name: Clear next release changelog (post release)
115118
if: inputs.phase == 'post'
@@ -119,10 +122,14 @@ jobs:
119122
- name: Push the ${{ inputs.phase }} release branch
120123
run: |
121124
git add --all
122-
git commit -m "${{ inputs.phase }} release: elastic-otel-java v${{ env.RELEASE_VERSION }}"
125+
git commit -m "${PHASE} release: elastic-otel-java v${{ env.RELEASE_VERSION }}"
123126
git push origin ${{ env.BRANCH_NAME }}
127+
env:
128+
PHASE: ${{ inputs.phase }}
124129

125130
- name: Create the ${{ inputs.phase }} release PR
126-
run: gh pr create --title="${{ inputs.pr_title }}" --base main --head ${{ env.BRANCH_NAME }} -b "${{ inputs.pr_body }}"
131+
run: gh pr create --title="${PR_TITLE}" --base main --head ${{ env.BRANCH_NAME }} -b "${PR_BODY}"
127132
env:
128133
GH_TOKEN: ${{ steps.get_token.outputs.token }}
134+
PR_TITLE: ${{ inputs.pr_title }}
135+
PR_BODY: ${{ inputs.pr_body }}

.github/workflows/validate-tag/action.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@ runs:
1515
id: validate-tag
1616
shell: 'bash'
1717
run: |
18-
if ! [ $(echo "${{ inputs.tag }}" | grep -P "(\d{1,2})\.(\d{1,2})\.(\d{1,2})") ]; then
18+
if ! [ $(echo "${TAG}" | grep -P "(\d{1,2})\.(\d{1,2})\.(\d{1,2})") ]; then
1919
echo "Tag should be a SemVer format"
2020
exit 1
2121
fi
22-
if [ $(git tag -l "${{ inputs.tag }}") ]; then
23-
echo "The tag ${{ inputs.tag }} already exists"
22+
if [ $(git tag -l "${TAG}") ]; then
23+
echo "The tag ${TAG} already exists"
2424
exit 1
2525
fi
26+
env:
27+
TAG: ${{ inputs.tag }}

0 commit comments

Comments
 (0)