Skip to content

Commit 3d6b2fd

Browse files
committed
* use native gh CLI for requirements actions
* update UV setup to version 7 * update Dependabot configuration
1 parent 5d95937 commit 3d6b2fd

4 files changed

Lines changed: 39 additions & 16 deletions

File tree

.github/actions/dependencies/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ description: Install UV and dependencies
33
runs:
44
using: composite
55
steps:
6-
- name: Install uv
7-
uses: astral-sh/setup-uv@v4
6+
- name: Set up uv
7+
uses: astral-sh/setup-uv@v7
88

99
- name: Install dependencies
1010
shell: bash

.github/actions/uv/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: Install UV
33
runs:
44
using: composite
55
steps:
6-
- name: Set up UV
7-
uses: astral-sh/setup-uv@v3
6+
- name: Set up uv
7+
uses: astral-sh/setup-uv@v7
88
with:
99
enable-cache: true

.github/dependabot.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,18 @@ updates:
1616
groups:
1717
actions:
1818
patterns:
19-
- "github-actions"
19+
- "*"
20+
21+
- package-ecosystem: "uv"
22+
directory: "/"
23+
schedule:
24+
interval: "monthly"
25+
commit-message:
26+
prefix: "deps(dependabot):"
27+
open-pull-requests-limit: 1
28+
rebase-strategy: "auto"
29+
groups:
30+
python-all:
31+
patterns:
32+
- "*"
33+

.github/workflows/make-requirements.yml

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ jobs:
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

Comments
 (0)