-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (51 loc) · 1.71 KB
/
Copy pathsync-flake-lock.yml
File metadata and controls
61 lines (51 loc) · 1.71 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
59
60
61
name: sync-flake-lock
on:
workflow_dispatch:
permissions:
contents: write
pull-requests: write
defaults:
run:
shell: bash -xe {0}
jobs:
sync-flake-lock:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 1
- name: Sync flake.lock from Obelisk
run: |
curl --fail --location \
https://raw.githubusercontent.com/obeli-sk/obelisk/refs/heads/latest/flake.lock \
--output flake.lock
- uses: nixbuild/nix-quick-install-action@v34
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
nix_conf: |
extra-substituters = https://obeli-sk.cachix.org
extra-trusted-public-keys = obeli-sk.cachix.org-1:31iM9GWSEhAXvvuTWQ7CvAcwvgRzsuJ9yJghywSd3Jw=
- name: Populate the Nix store
run: nix develop --command echo
- name: Update dev-deps.txt
run: nix develop --command ./scripts/dev-deps.sh
- name: Create pull request
env:
GH_TOKEN: ${{ secrets.GH_TOKEN_PR_RW }}
run: |
if git diff --quiet; then
echo "No changes to commit."
exit 0
fi
branch="sync-flake-lock-$(date +'%Y%m%d-%H%M%S')"
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git checkout -b "$branch"
git add flake.lock dev-deps.txt
git commit -m "chore: Sync \`flake.lock\` from upstream"
git push origin "$branch"
gh pr create \
--base main \
--head "$branch" \
--title "Sync \`flake.lock\` from upstream" \
--body ''