-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (41 loc) · 1.39 KB
/
update.yaml
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
name: "Update lock file"
on:
schedule:
- cron: "0 */6 * * *"
workflow_dispatch:
jobs:
tests:
runs-on: ubuntu-22.04
steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate a GitHub App token
uses: tibdex/[email protected]
id: generate-token
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- name: Setup Git author
run: |
git config user.name 'GitHub Actions'
git config user.email '[email protected]'
- name: Update lock file
run: nix flake update --no-registries --commit-lock-file
- name: Get commit message
id: commit
run: |
delimiter="$(openssl rand -hex 16)"
echo "message<<${delimiter}" >> "${GITHUB_OUTPUT}"
git log -1 --pretty=%B | tail +3 | awk -f ./misc/flake-to-markdown.awk >> "${GITHUB_OUTPUT}"
echo "${delimiter}" >> "${GITHUB_OUTPUT}"
- name: Create Pull Request
uses: peter-evans/[email protected]
with:
token: "${{ steps.generate-token.outputs.token }}"
title: "Automated Flake update"
body: "${{ steps.commit.outputs.message }}"
delete-branch: true