You need to sign in or sign up before continuing.
Unverified Commit f0ac7aaa authored by Yih-Dar's avatar Yih-Dar Committed by GitHub
Browse files

Security fix (#10905)



fix
Co-authored-by: default avatarydshieh <ydshieh@users.noreply.github.com>
parent 613e77f8
...@@ -53,9 +53,9 @@ jobs: ...@@ -53,9 +53,9 @@ jobs:
HEADREF: ${{ steps.pr_info.outputs.headRef }} HEADREF: ${{ steps.pr_info.outputs.headRef }}
PRNUMBER: ${{ steps.pr_info.outputs.prNumber }} PRNUMBER: ${{ steps.pr_info.outputs.prNumber }}
run: | run: |
echo "PR number: ${{ env.PRNUMBER }}" echo "PR number: $PRNUMBER"
echo "Head Ref: ${{ env.HEADREF }}" echo "Head Ref: $HEADREF"
echo "Head Repo Full Name: ${{ env.HEADREPOFULLNAME }}" echo "Head Repo Full Name: $HEADREPOFULLNAME"
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v4 uses: actions/setup-python@v4
...@@ -89,20 +89,20 @@ jobs: ...@@ -89,20 +89,20 @@ jobs:
PRNUMBER: ${{ steps.pr_info.outputs.prNumber }} PRNUMBER: ${{ steps.pr_info.outputs.prNumber }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: | run: |
echo "HEADREPOFULLNAME: ${{ env.HEADREPOFULLNAME }}, HEADREF: ${{ env.HEADREF }}" echo "HEADREPOFULLNAME: $HEADREPOFULLNAME, HEADREF: $HEADREF"
# Configure git with the Actions bot user # Configure git with the Actions bot user
git config user.name "github-actions[bot]" git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com" git config user.email "github-actions[bot]@users.noreply.github.com"
# Make sure your 'origin' remote is set to the contributor's fork # Make sure your 'origin' remote is set to the contributor's fork
git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${{ env.HEADREPOFULLNAME }}.git" git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/$HEADREPOFULLNAME.git"
# If there are changes after running style/quality, commit them # If there are changes after running style/quality, commit them
if [ -n "$(git status --porcelain)" ]; then if [ -n "$(git status --porcelain)" ]; then
git add . git add .
git commit -m "Apply style fixes" git commit -m "Apply style fixes"
# Push to the original contributor's forked branch # Push to the original contributor's forked branch
git push origin HEAD:${{ env.HEADREF }} git push origin HEAD:$HEADREF
echo "changes_pushed=true" >> $GITHUB_OUTPUT echo "changes_pushed=true" >> $GITHUB_OUTPUT
else else
echo "No changes to commit." echo "No changes to commit."
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment