1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-26 22:53:14 -04:00

Fix pr preview vulnerability (#5461)

* Closes #5458
* [x] I have followed the instructions in the PR template
This commit is contained in:
lucasmerlin
2024-12-11 16:55:57 +01:00
committed by GitHub
parent 4362a242b0
commit 36a70e12c3
3 changed files with 12 additions and 9 deletions

View File

@@ -42,9 +42,11 @@ jobs:
- name: Generate meta.json
env:
PR_NUMBER: ${{ github.event.number }}
PR_BRANCH: ${{ github.head_ref }}
URL_SLUG: ${{ github.event.number }}-${{ github.head_ref }}
run: |
echo "{\"pr_number\": \"$PR_NUMBER\", \"pr_branch\": \"$PR_BRANCH\"}" > meta.json
# Sanitize the URL_SLUG to only contain alphanumeric characters and dashes
URL_SLUG=$(echo $URL_SLUG | tr -cd '[:alnum:]-')
echo "{\"pr_number\": \"$PR_NUMBER\", \"url_slug\": \"$URL_SLUG\"}" > meta.json
- uses: actions/upload-artifact@v4
with: