Skip to content

Commit 8e8a425

Browse files
authored
[Workflow] security fix (#3383)
* Refactor style command handling in workflow * Fix version assignment in Python prerelease workflow
1 parent 04d42bc commit 8e8a425

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

.github/workflows/python-prerelease.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ jobs:
2121
steps:
2222
- name: Determine version from tag
2323
id: get-version
24+
env:
25+
TAG : ${{ inputs.tag }}
2426
run: |
2527
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
26-
echo "VERSION=${{ inputs.tag }}" >> $GITHUB_OUTPUT
28+
echo "VERSION=$TAG" >> $GITHUB_OUTPUT
2729
else
2830
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
2931
fi

.github/workflows/style-bot-action.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,10 @@ jobs:
165165
166166
- name: Run style command
167167
id: run_style
168+
env:
169+
STYLECOMMANDTYPE : ${{ inputs.style_command_type }}
168170
run: |
169-
case "${{ inputs.style_command_type }}" in
171+
case "$STYLECOMMANDTYPE" in
170172
"default")
171173
echo "Running default style and quality checks"
172174
make style && make quality
@@ -180,7 +182,7 @@ jobs:
180182
make style
181183
;;
182184
*)
183-
echo "Invalid style_command_type: ${{ inputs.style_command_type }}"
185+
echo "Invalid style_command_type: $STYLECOMMANDTYPE"
184186
echo "Valid options are: 'default', 'quality_only', 'style_only'"
185187
exit 1
186188
;;
@@ -237,4 +239,4 @@ jobs:
237239
body: `${{ steps.prepare_final_comment.outputs.final_comment }}`
238240
});
239241
env:
240-
prNumber: ${{ steps.pr_info.outputs.prNumber }}
242+
prNumber: ${{ steps.pr_info.outputs.prNumber }}

0 commit comments

Comments
 (0)