Skip to content

Commit ffb3779

Browse files
committed
Use environment variables in run command
Recommended by https://securitylab.github.com/research/github-actions-untrusted-input/
1 parent 6777a1b commit ffb3779

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

.github/workflows/test.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,21 @@ jobs:
4747
with:
4848
fetch-depth: 0
4949
- name: Rebase PHP8 branch
50+
env:
51+
USER_EMAIL: ${{ github.event.pusher.email }}
52+
USER_NAME: ${{ github.event.pusher.name }}
53+
REBASE_TARGET: ${{ github.head_ref || github.ref_name }}
5054
run: |
51-
git config user.email "${{ github.event.pusher.email }}"
52-
git config user.name "${{ github.event.pusher.name }}"
55+
git config user.email "$USER_EMAIL"
56+
git config user.name "$USER_NAME"
5357
git pull
5458
git checkout php8
55-
git rebase ${{ github.head_ref || github.ref_name }} php8
59+
git rebase "$REBASE_TARGET" php8
5660
git status
5761
echo 'diff origin/php8:'
5862
git diff origin/php8
5963
echo 'diff current:'
60-
git diff ${{ github.head_ref || github.ref_name }}
64+
git diff "$REBASE_TARGET"
6165
- uses: shivammathur/setup-php@v2
6266
with:
6367
php-version: ${{matrix.php}}

0 commit comments

Comments
 (0)