Skip to content

Commit 07b1c76

Browse files
authored
ci: fix semgrep reported run-shell-injection (#347)
* ci: fix semgrep reported run-shell-injection * updated PR according to reviews
1 parent 80f5f77 commit 07b1c76

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,7 @@ runs:
2525
java-version-file: .java-version
2626
distribution: ${{ inputs.distribution }}
2727
cache: 'maven'
28-
- run: ${{ inputs.command }}
28+
- run: "${COMMAND}"
2929
shell: ${{ inputs.shell }}
30+
env:
31+
COMMAND: ${{ inputs.command }}

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,14 @@ jobs:
9999
- name: Push the ${{ inputs.phase }} release branch
100100
run: |
101101
git add --all
102-
git commit -m "${{ inputs.phase }} release: ecs-logging-java v${{ env.RELEASE_VERSION }}"
102+
git commit -m "${PHASE} release: ecs-logging-java v${{ env.RELEASE_VERSION }}"
103103
git push origin ${{ env.BRANCH_NAME }}
104+
env:
105+
PHASE: ${{ inputs.phase }}
104106

105107
- name: Create the ${{ inputs.phase }} release PR
106-
run: gh pr create --title="${{ inputs.pr_title }}" --base main --head ${{ env.BRANCH_NAME }} -b "${{ inputs.pr_body }}"
108+
run: gh pr create --title="${PR_TITLE}" --base main --head ${{ env.BRANCH_NAME }} -b "${PR_BODY}"
107109
env:
108110
GH_TOKEN: ${{ steps.get_token.outputs.token }}
111+
PR_TITLE: ${{ inputs.pr_title }}
112+
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)