Skip to content

Commit 10bb103

Browse files
authored
Merge pull request #1218 from NotAShelf/notashelf/push-oxwuxnlzqysp
ci: simplify dependabot config
2 parents da5c914 + aab08f3 commit 10bb103

File tree

2 files changed

+92
-5
lines changed

2 files changed

+92
-5
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
version: 2
22
updates:
33
- package-ecosystem: github-actions
4+
open-pull-requests-limit: 15
45
directory: "/"
56
schedule:
67
interval: daily
7-
open-pull-requests-limit: 15
8-
reviewers:
9-
- NotAShelf
10-
assignees:
11-
- NotAShelf

.github/workflows/update.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Weekly Dependency Updates
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
# 8 PM UTC every Friday
6+
- cron: '0 20 * * 5'
7+
jobs:
8+
update-dependencies:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout repository
12+
uses: actions/checkout@v5
13+
14+
- name: "Install Nix"
15+
uses: cachix/install-nix-action@v31.8.2
16+
17+
- name: Set up Git
18+
run: |
19+
git config user.name "GitHub Actions Bot"
20+
git config user.email "actions@github.com"
21+
22+
- name: Create branch for updates
23+
run: |
24+
DATE=$(date +%Y-%m-%d)
25+
BRANCH_NAME="update/dependencies-$DATE"
26+
git checkout -b $BRANCH_NAME
27+
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
28+
29+
- name: Update npins
30+
run: nix run nixpkgs#npins update
31+
32+
# Only update Nixpkgs. mnw might break on update, better to track it manually to avoid
33+
# unexpected breakage.
34+
- name: Update nixpkgs
35+
run: nix flake update nixpkgs
36+
37+
- name: Check for changes
38+
id: check_changes
39+
run: |
40+
if git diff --quiet; then
41+
echo "No changes detected"
42+
echo "changes_detected=false" >> "$GITHUB_OUTPUT"
43+
exit 0
44+
else
45+
echo "Changes detected"
46+
echo "changes_detected=true" >> "$GITHUB_OUTPUT"
47+
fi
48+
49+
# FIXME: Worth adding additional checks for, e.g., fragile plugins
50+
# or modules
51+
# nix build .#checks.<system>.<check-name>
52+
# We'll probably want to handle this with machine tests
53+
- name: Verify changes
54+
if: steps.check_changes.outputs.changes_detected == 'true'
55+
run: |
56+
# Run verification tests to ensure updates don't break anything
57+
nix flake check
58+
59+
60+
- name: Set date variable
61+
run: echo "DATE=$(date +%Y-%m-%d)" >> "$GITHUB_ENV"
62+
63+
- name: Commit and push changes
64+
if: steps.check_changes.outputs.changes_detected == 'true'
65+
run: |
66+
git add .
67+
git commit -m "pins: bump all plugins (${{ env.DATE }})"
68+
git push -u origin $BRANCH_NAME
69+
70+
- name: Create Pull Request
71+
if: steps.check_changes.outputs.changes_detected == 'true'
72+
uses: peter-evans/create-pull-request@v7
73+
with:
74+
branch: ${{ env.BRANCH_NAME }}
75+
base: main
76+
labels: dependencies,automated pr
77+
token: ${{ secrets.GITHUB_TOKEN }}
78+
commit-message: "npins: bump all plugins (${{ env.DATE }})"
79+
title: "Weekly Dependency Updates: ${{ env.DATE }}"
80+
body: |
81+
> [!NOTE]
82+
> This PR was automatically generated by the Weekly Dependency Updates workflow. Please wait
83+
> for all CI steps to complete, and test any major changes personally.
84+
85+
Updates Performed:
86+
87+
- Updated dependencies using `npins update`
88+
- Updated nixpkgs using `nix flake update nixpkgs`
89+
90+
If the verification steps have passed, updates should be safe to merge. For failing CI steps
91+
submit a Pull Request targetting ${{ env.BRANCH_NAME }}

0 commit comments

Comments
 (0)