Skip to content

Commit 433c1f4

Browse files
committed
Enable Renovate for upgrading dependencies
1 parent 95f970c commit 433c1f4

7 files changed

Lines changed: 152 additions & 55 deletions

File tree

.github/prompts/renovate-pr.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Review and fix this Renovate dependency update PR.
2+
3+
Hard requirements:
4+
5+
- Read and follow `AGENTS.md` and any project-specific `AGENTS.md` files.
6+
- Treat this PR as a dependency maintenance PR only. Do not make unrelated
7+
refactors or feature changes.
8+
- Preserve public API and binary compatibility.
9+
- Inspect the dependency/build-tool updates already made by Renovate.
10+
- Run `make check-all`.
11+
- If the build, formatting, compilation, or tests fail, fix the failures on
12+
this PR branch.
13+
- If no code changes are needed, leave the branch unchanged.
14+
- Do not merge or close the PR.
15+
16+
When finished, summarize what you checked, what you fixed, and whether
17+
`make check-all` passes.

.github/renovate-config.js

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
module.exports = {
2+
platform: "github",
3+
repositories: ["funfix/tasks"],
4+
gitAuthor: "Renovate Bot <renovate@funfix.org>",
5+
branchPrefix: "renovate/",
6+
onboarding: false,
7+
requireConfig: "optional",
8+
recreateWhen: "always",
9+
prHourlyLimit: 0,
10+
11+
extends: [":dependencyDashboard"],
12+
13+
enabledManagers: ["github-actions", "gradle", "gradle-wrapper", "sbt"],
14+
15+
ignorePaths: ["**/.gradle/**"],
16+
17+
packageRules: [
18+
{
19+
description: "Group all dependency updates into a single PR",
20+
matchManagers: ["github-actions", "gradle", "gradle-wrapper", "sbt"],
21+
groupName: "dependencies",
22+
groupSlug: "all-dependencies",
23+
group: {
24+
commitMessageTopic: "dependencies",
25+
commitMessageExtra: "",
26+
},
27+
},
28+
{
29+
description: "Only use stable dotted numeric JVM dependency versions",
30+
matchManagers: ["gradle", "gradle-wrapper", "sbt"],
31+
allowedVersions: "/^\\d+(?:\\.\\d+)+$/",
32+
},
33+
{
34+
description: "Keep Scala on the 3.3.x line",
35+
matchManagers: ["sbt"],
36+
matchPackageNames: ["org.scala-lang:scala3-library_3"],
37+
allowedVersions: "/^3\\.3\\.\\d+$/",
38+
},
39+
{
40+
description: "Wait one week before proposing dependency updates",
41+
matchManagers: ["github-actions", "gradle", "gradle-wrapper", "sbt"],
42+
minimumReleaseAge: "7 days",
43+
minimumReleaseAgeBehaviour: "timestamp-optional",
44+
},
45+
],
46+
};
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: opencode-renovate
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, ready_for_review]
6+
7+
concurrency:
8+
group: opencode-renovate-${{ github.event.pull_request.number }}
9+
cancel-in-progress: true
10+
11+
jobs:
12+
opencode:
13+
if: |
14+
github.event.pull_request.head.repo.full_name == github.repository &&
15+
startsWith(github.event.pull_request.head.ref, 'renovate/') &&
16+
github.actor != 'github-actions[bot]' &&
17+
!github.event.pull_request.draft
18+
runs-on: ubuntu-latest
19+
permissions:
20+
id-token: write
21+
contents: write
22+
pull-requests: write
23+
issues: write
24+
steps:
25+
- name: Checkout Renovate PR branch
26+
uses: actions/checkout@v6
27+
with:
28+
repository: ${{ github.event.pull_request.head.repo.full_name }}
29+
ref: ${{ github.event.pull_request.head.ref }}
30+
persist-credentials: false
31+
32+
- uses: actions/setup-java@v5
33+
with:
34+
java-version: "17"
35+
distribution: temurin
36+
- uses: sbt/setup-sbt@v1
37+
38+
- name: Configure git
39+
run: |
40+
git config --global user.name "github-actions[bot]"
41+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
42+
git config --global credential.helper '!f() { echo username=x-access-token; echo password=$GITHUB_TOKEN; }; f'
43+
44+
- name: Load prompt file
45+
id: load-prompt
46+
run: |
47+
echo "content<<EOF" >> $GITHUB_OUTPUT
48+
cat .github/prompts/renovate-pr.md >> $GITHUB_OUTPUT
49+
echo "EOF" >> $GITHUB_OUTPUT
50+
51+
- name: Run opencode
52+
uses: anomalyco/opencode/github@latest
53+
env:
54+
OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }}
55+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
with:
58+
model: opencode-go/deepseek-v4-pro
59+
use_github_token: true
60+
prompt: ${{ steps.load-prompt.outputs.content }}

.github/workflows/opencode-upgrades.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

.github/workflows/renovate.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Renovate
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
# Runs every Monday at 09:00 UTC
7+
- cron: "0 9 * * 1"
8+
9+
jobs:
10+
renovate:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v6
15+
16+
- name: Renovate
17+
uses: renovatebot/github-action@v46.1.14
18+
with:
19+
configurationFile: .github/renovate-config.js
20+
token: ${{ secrets.RENOVATE_TOKEN }}
21+
# env:
22+
# LOG_LEVEL: debug

AGENTS.md

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,10 @@ Use the **jspecify-nullness** skill when working with JSpecify annotations, null
1414

1515
## Acceptance Criteria
1616

17-
For all work to be considered complete:
18-
```sh
19-
./gradlew check
20-
```
21-
22-
## HOW-TOs
17+
Work is not done until `make check-all` passes.
2318

24-
### Update project's dependencies
25-
26-
```bash
27-
make dependency-updates-ci
19+
```sh
20+
make check-all
2821
```
2922

30-
This will generate these reports:
31-
- For the Gradle project(s):
32-
- `./build/dependencyUpdates/report.html`
33-
- `./tasks-jvm/build/dependencyUpdates/report.html`
34-
- `./tasks-kotlin-coroutines/build/dependencyUpdates/report.html`
3523

36-
RULES:
37-
- Never upgrade major versions (semver), instead ask the user or warn them!!!
38-
- Never upgrade to SNAPSHOT, RC, or milestone versions.
39-
- Fix breakage, but apply good judgement.

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
.PHONY: build
1+
.PHONY: build check-all
22

33
build:
44
./gradlew build
55

6+
check-all:
7+
./gradlew check
8+
69
dependency-updates:
710
./gradlew dependencyUpdates \
811
-Drevision=release \

0 commit comments

Comments
 (0)