-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (46 loc) · 1.51 KB
/
Copy pathweeklyUpdate.yml
File metadata and controls
58 lines (46 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Weekly Flake Update
on:
schedule:
- cron: "0 3 * * 1" # every Monday at 03:00 UTC
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
flake_update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@v12
- name: Set branch name (date)
id: vars
run: |
echo "branch=flake-update/$(date +%Y-%m-%d)" >> $GITHUB_OUTPUT
- name: Create update branch
run: |
git checkout -B ${{ steps.vars.outputs.branch }}
- name: Update flake inputs
run: |
nix flake update
- name: Commit changes
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add flake.lock
git commit -m "chore: weekly flake update" || echo "No changes to commit"
- name: Push branch
run: |
git push origin ${{ steps.vars.outputs.branch }} --force
- name: Install GitHub CLI
run: |
sudo apt-get update
sudo apt-get install -y gh
- name: Create Pull Request
run: |
gh pr create \
--base main \
--head ${{ steps.vars.outputs.branch }} \
--title "[Automated] Weekly flake update $(date +%Y-%m-%d)" \
--body "Automated weekly update of flake inputs for $(date +%Y-%m-%d)."
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}