6464 open-PR :
6565 needs : [make-requirements]
6666 runs-on : ubuntu-latest
67+ permissions :
68+ contents : write
69+ pull-requests : write
6770 steps :
6871 - uses : actions/checkout@v4
6972 - name : Download linux requirements files
@@ -93,14 +96,20 @@ jobs:
9396 run : echo "timestamp=$(date +'%Y-%m-%d_%H-%M')" >> $GITHUB_OUTPUT
9497
9598 - name : Create Pull Request
96- uses : peter-evans/create-pull-request@v8
97- with :
98- base : main
99- title : admin/requirements-update_${{ steps.timestamp.outputs.timestamp }}
100- body : Updating requirements.txt.
101-
102- Due to some [challenges](https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs),
103- with getting this PR to trigger the tests, please manually close and re-open this PR.
104- branch : admin/requirements-update_${{ steps.timestamp.outputs.timestamp }}
105- commit-message : Updating requirements.txt after change to `uv.lock` was pushed to `main`
106- delete-branch : true
99+ env :
100+ GH_TOKEN : ${{ secrets.WORKFLOW_PAT }}
101+ run : |
102+ git config user.name "github-actions[bot]"
103+ git config user.email "github-actions[bot]@users.noreply.github.com"
104+ git remote set-url origin https://x-access-token:${{ secrets.WORKFLOW_PAT }}@github.com/${{ github.repository }}
105+ BRANCH="admin/requirements-update_${{ steps.timestamp.outputs.timestamp }}"
106+ git checkout -b "$BRANCH"
107+ git add requirements/
108+ git diff --cached --quiet && echo "No changes to commit" && exit 0
109+ git commit -m "Updating requirements.txt after change to \`uv.lock\` was pushed to \`main\`"
110+ git push origin "$BRANCH"
111+ gh pr create \
112+ --base main \
113+ --head "$BRANCH" \
114+ --title "admin/requirements-update_${{ steps.timestamp.outputs.timestamp }}" \
115+ --body "Updating requirements.txt."
0 commit comments