Skip to content

Commit 1bdbc07

Browse files
committed
github actions: Quote all script expressions that can have special chars
Branch names and repository names can contain special characters. Quote all such expressions used in shell scripts.
1 parent c4f6b9e commit 1bdbc07

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

.github/workflows/validate-kernel-commits.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
- name: Checkout base branch
2424
run: |
25-
git fetch origin ${{ github.base_ref }}:${{ github.base_ref }}
25+
git fetch origin "${{ github.base_ref }}":"${{ github.base_ref }}"
2626
2727
- name: Checkout kernel-src-tree-tools
2828
uses: actions/checkout@v4
@@ -82,7 +82,7 @@ jobs:
8282
run: |
8383
if ! gh pr comment ${{ github.event.pull_request.number }} \
8484
--body-file ckc_result.txt \
85-
--repo ${{ github.repository }}; then
85+
--repo "${{ github.repository }}"; then
8686
echo "❌ Failed to post check-kernel-commits comment to PR"
8787
exit 1
8888
fi
@@ -146,7 +146,7 @@ jobs:
146146
run: |
147147
if ! gh pr comment ${{ github.event.pull_request.number }} \
148148
--body-file interdiff_result.txt \
149-
--repo ${{ github.repository }}; then
149+
--repo "${{ github.repository }}"; then
150150
echo "❌ Failed to post interdiff comment to PR"
151151
exit 1
152152
fi
@@ -176,8 +176,8 @@ jobs:
176176
set +e # Don't exit on error, we want to capture the output
177177
OUTPUT=$(python3 jira_pr_check.py \
178178
--kernel-src-tree .. \
179-
--merge-target ${{ github.base_ref }} \
180-
--pr-branch ${{ github.head_ref }} 2>&1)
179+
--merge-target "${{ github.base_ref }}" \
180+
--pr-branch "${{ github.head_ref }}" 2>&1)
181181
EXIT_CODE=$?
182182
183183
# Filter out any potential credential leaks from output
@@ -218,7 +218,7 @@ jobs:
218218
run: |
219219
if ! gh pr comment ${{ github.event.pull_request.number }} \
220220
--body "${{ steps.jira_check.outputs.output }}" \
221-
--repo ${{ github.repository }}; then
221+
--repo "${{ github.repository }}"; then
222222
echo "❌ Failed to post JIRA check comment to PR"
223223
exit 1
224224
fi
@@ -231,7 +231,7 @@ jobs:
231231
gh pr review ${{ github.event.pull_request.number }} \
232232
--request-changes \
233233
--body "⚠️ This PR contains VULN tickets that do not match the target LTS product. Please review the JIRA ticket assignments and ensure they match the merge target branch." \
234-
--repo ${{ github.repository }}
234+
--repo "${{ github.repository }}"
235235
236236
- name: Fail workflow if JIRA errors found
237237
if: steps.jira_check.outcome == 'failure'

0 commit comments

Comments
 (0)