File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load diff This file was deleted.
Original file line number Diff line number Diff line change 1+ ---
2+ name : Update uvmirror file
3+
4+ env :
5+ BRANCH_NAME : ${{ github.head_ref || github.ref_name }}
6+
7+ permissions :
8+ contents : read
9+
10+ on :
11+ pull_request :
12+ workflow_dispatch :
13+
14+ jobs :
15+ check-uvmirror :
16+ runs-on : ubuntu-24.04
17+ outputs :
18+ changed : ${{ steps.check_for_changes.outputs.changed }}
19+ steps :
20+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
21+ - uses : opensafely-core/setup-action@93841f27c28c75bf85b1a0a915e2391a06c6c8a6 # v1
22+ with :
23+ install-just : true
24+ install-uv : true
25+ cache : uv
26+
27+ - name : Ensure requirements.uvmirror is consistent with uv.lock
28+ run : just uvmirror
29+
30+ - id : check_for_changes
31+ run : echo "changed=$(git diff -s --exit-code requirements.uvmirror || echo 1)" >> "$GITHUB_OUTPUT"
32+
33+ update_uvmirror :
34+
35+ needs : check-uvmirror
36+ if : ${{ (github.actor != 'dependabot[bot]') && (needs.check-uvmirror.outputs.changed ) }}
37+ runs-on : ubuntu-24.04
38+
39+ steps :
40+ - uses : actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3
41+ id : generate-token
42+ with :
43+ app-id : ${{ vars.CREATE_PR_APP_ID }}
44+ private-key : ${{ secrets.CREATE_PR_APP_PRIVATE_KEY }}
45+
46+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
47+ with :
48+ ref : ${{ env.BRANCH_NAME }}
49+ token : ${{ steps.generate-token.outputs.token }}
50+
51+ - uses : opensafely-core/setup-action@93841f27c28c75bf85b1a0a915e2391a06c6c8a6 # v1
52+ with :
53+ install-just : true
54+ install-uv : true
55+ cache : uv
56+
57+ - name : Ensure requirements.uvmirror is consistent with uv.lock
58+ run : just uvmirror
59+
60+ - name : Commit uvmirror changes
61+ env :
62+ GITHUB_TOKEN : ${{ steps.generate-token.outputs.token }}
63+ run : |
64+ git add requirements.uvmirror
65+ git -c user.name="opensafely-github-bot" -c user.email=opensafely-github-bot@users.noreply.github.com commit -m "Update uvmirror file"
66+ git push origin ${{ env.BRANCH_NAME }}
You can’t perform that action at this time.
0 commit comments