1919
2020    env :
2121      BRANCH_NAME : auto-dependency-upgrades-${{ matrix.runs-on }} 
22+       REF_NAME : ${{ github.ref_name }} 
23+       RUNS_ON : ${{ matrix.runs-on}} 
2224
2325    steps :
2426      - uses : actions/checkout@v4 
27+         with :
28+            persist-credentials : false 
2529      - uses : actions/setup-python@v5 
2630        with :
2731          #  Keep in-sync with ./pyoxidizer.yml
@@ -44,22 +48,24 @@ jobs:
4448          git config user.name github-actions 
4549          git config user.email [email protected]  4650          git add . 
47-           git commit -m "Automated dependency upgrades for ${{ matrix.runs-on}}"  
48-           git push -f origin ${{ github.ref_name }}:${{ env. BRANCH_NAME }}  
51+           git commit -m "Automated dependency upgrades for $RUNS_ON  
52+           git push -f origin $REF_NAME:$ BRANCH_NAME 
4953
5054       - name : Open pull request if needed 
5155        if : steps.changes.outputs.count > 0 
5256        shell : bash 
5357        env :
5458          GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} 
59+           RUN_ID : ${{ github.run_id }} 
60+           REPO : ${{ github.repository }} 
5561        #  Only open a PR if the branch is not attached to an existing one
5662        run : | 
57-           PR=$(gh pr list --head ${{ env. BRANCH_NAME }}  --json number -q '.[0].number') 
63+           PR=$(gh pr list --head $BRANCH_NAME --json number -q '.[0].number') 
5864          if [ -z $PR ]; then 
5965            gh pr create \ 
60-             --head ${{ env. BRANCH_NAME }}  \ 
61-             --title "Automated dependency upgrades for ${{ matrix.runs-on}} " \ 
62-             --body "Full log: https://github.com/${{ github.repository }} /actions/runs/${{ github.run_id }} " 
66+             --head $BRANCH_NAME \ 
67+             --title "Automated dependency upgrades for $RUNS_ON " \ 
68+             --body "Full log: https://github.com/$REPO /actions/runs/$RUN_ID " 
6369          else 
6470            echo "Pull request already exists, won't create a new one." 
6571          fi 
0 commit comments