-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (44 loc) · 1.57 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
on:
schedule:
- cron: "0 0 1,15 * *" # run on the 1st and 15th of every month
workflow_dispatch:
inputs:
dry-run:
description: "Dry run: if `true`, a pull request will not be made."
type: boolean
required: true
default: false
run-name: Update flake inputs and npins
env:
GIT_USERNAME: github-actions[bot]
GIT_EMAIL: github-actions[bot]@users.noreply.github.com
jobs:
update:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- uses: cachix/install-nix-action@v26
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Configure git
run: nix develop .#ci --impure --command configure-git-user.sh "${{ env.GIT_USERNAME }}" "${{ env.GIT_EMAIL }}"
- name: Update flake inputs
run: |
nix flake update
git commit -am "chore(flake): update inputs"
- name: Update npins
run: |
nix develop .#ci --impure --command npins -d "planet/pkgs/npins" update
nix develop .#ci --impure --command npins -d "planet/pkgs/vim-plugins/npins" update
git commit -am "chore(planet/pkgs): update npins"
- if: ${{ !inputs.dry-run }}
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.PR_PAT }}
branch: update-flake-inputs-and-npins
title: Update flake inputs and npins
body: ${{ github.event_name == 'workflow_dispatch' && 'Manually triggered update.' || 'Automated periodic update.' }}