Skip to content

Commit dcd3a8f

Browse files
Copilotslachiewicz
andcommitted
Fix security issues in site workflow - use env vars for untrusted input
Co-authored-by: slachiewicz <6705942+slachiewicz@users.noreply.github.com>
1 parent 689d547 commit dcd3a8f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

.github/workflows/site.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,14 @@ jobs:
4646
- name: Setup deploy
4747
id: setup
4848
if: github.event_name == 'push' && github.repository_owner == 'codehaus-plexus' && github.ref == 'refs/heads/source'
49+
env:
50+
COMMIT_EMAIL: ${{ github.event.head_commit.author.email }}
51+
COMMIT_NAME: ${{ github.event.head_commit.author.name }}
52+
COMMIT_ID: ${{ github.event.head_commit.id }}
4953
run: |
50-
git config --global user.email "${{ github.event.head_commit.author.email }}"
51-
git config --global user.name "${{ github.event.head_commit.author.name }}"
52-
echo "deploy=-deploy -Dusername=git -Dpassword=${{ github.token }} -Dscmpublish.checkinComment='Site checkin for ${{ github.event.head_commit.id }}'" >> $GITHUB_OUTPUT
54+
git config --global user.email "$COMMIT_EMAIL"
55+
git config --global user.name "$COMMIT_NAME"
56+
echo "deploy=-deploy -Dusername=git -Dpassword=${{ github.token }} -Dscmpublish.checkinComment='Site checkin for $COMMIT_ID'" >> "$GITHUB_OUTPUT"
5357
5458
- name: Build with Maven
5559
run: mvn --show-version --errors --batch-mode --update-snapshots clean site${{ steps.setup.outputs.deploy }}

0 commit comments

Comments
 (0)