-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (37 loc) · 1.31 KB
/
update.yml
File metadata and controls
40 lines (37 loc) · 1.31 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
name: Update flake inputs
on:
schedule:
- cron: "10 5 * * *"
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v31
- name: Setup git identity
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- name: Update
run: nix flake update --commit-lock-file
- name: Get update details
id: update-details
run: |
body=$(git log -1 --pretty=%B)
echo "body<<EOF" >> "$GITHUB_OUTPUT"
echo "$body" >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
- uses: peter-evans/create-pull-request@v7
id: create-pr
with:
branch: gh/update-flake
title: "chore: update flake inputs"
body: ${{ steps.update-details.outputs.body }}
# Use a PAT so that Workflows run on the created PR
token: ${{ secrets.CREATE_PR_TOKEN }}
- if: ${{ steps.create-pr.outputs.pull-request-number }}
name: Enable auto-merge after requirements met
run: gh pr merge --squash --auto "${{ steps.create-pr.outputs.pull-request-number }}"
env:
GH_TOKEN: ${{ secrets.CREATE_PR_TOKEN }}