-
Notifications
You must be signed in to change notification settings - Fork 17
33 lines (31 loc) · 1.01 KB
/
flake-update.yml
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
name: flake-update
on:
workflow_dispatch:
inputs:
branch:
description: "branch"
type: "string"
default: "dev"
jobs:
flake-update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- uses: DeterminateSystems/nix-installer-action@v16
- name: update `flake.lock`
run: nix flake update
- name: commit
run: |
[[ $(git diff) != "" ]] || exit 0
COMMITTER=$(curl "https://api.github.com/search/commits?q=author:${{ github.actor }}&sort=author-date&order=desc&page=1" | jq '.items[0].commit.committer')
NAME=$(echo "$COMMITTER" | jq '.name')
EMAIL=$(echo "$COMMITTER" | jq '.email')
git config --local user.name "$NAME"
git config --local user.email "$EMAIL"
git add flake.lock
git commit -m "update \`flake.lock\`"
- uses: ad-m/github-push-action@master
with:
branch: ${{ inputs.branch }}