Skip to content

Commit baa6f51

Browse files
committed
fix(ci): harden workflow against command injection
1 parent 2a8a425 commit baa6f51

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

.github/workflows/ubuntu_version_sync.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ on:
2222

2323
jobs:
2424
check-sync:
25+
name: Ubuntu File Synchronization Check
2526
runs-on: ubuntu-latest
27+
env:
28+
BASE_SHA: ${{ github.event.pull_request.base.sha }}
29+
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
2630
steps:
2731
- name: 'Checkout code'
2832
uses: actions/checkout@v4
@@ -34,7 +38,7 @@ jobs:
3438
run: |
3539
set -e
3640
37-
MODIFIED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }}...${{ github.event.pull_request.head.sha }})
41+
MODIFIED_FILES=$(git diff --name-only $BASE_SHA...$HEAD_SHA)
3842
echo "Checking for synchronized file changes..."
3943
echo "Modified files in this PR:"
4044
echo "$MODIFIED_FILES"

0 commit comments

Comments
 (0)