forked from klarkc/nix-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (51 loc) · 2.05 KB
/
Copy pathupdate-flake-lock-inputs.yml
File metadata and controls
51 lines (51 loc) · 2.05 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
name: update-flake-lock-inputs
on:
workflow_dispatch: # allows manual triggering
inputs:
templates:
description: 'Template paths (e.g., [ "tmpl1", "tmpl2"])'
required: true
flake_inputs:
description: 'Flake inputs to update (e.g., ["inp1", "inp2"])'
required: true
jobs:
lockfile:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
template: ${{ fromJson(github.event.inputs.templates) }}
input: ${{ fromJson(github.event.inputs.flake_inputs) }}
steps:
- name: Generate token
id: generate_token
uses: actions/create-github-app-token@v2.2.1
with:
app-id: ${{ secrets.BOT_APP_ID }}
private-key: ${{ secrets.BOT_PRIVATE_KEY }}
- name: Checkout repository
uses: actions/checkout@v4
- uses: DeterminateSystems/determinate-nix-action@v3.8.2
with:
extra-config: accept-flake-config = true
- name: Update ${{ matrix.template }} flake.lock ${{ matrix.input }}
uses: DeterminateSystems/update-flake-lock@v28
with:
path-to-flake-dir: ${{ matrix.template }}
commit-msg: "build(${{ matrix.template }}): Bump flake.lock ${{ matrix.input }}"
pr-title: "Update ${{ matrix.template }} flake.lock ${{ matrix.input }}"
pr-labels: |
dependencies
automated
token: ${{ steps.generate_token.outputs.token }}
branch: "update_${{ matrix.template }}_flake_lock_${{ matrix.input }}_action"
inputs: ${{ matrix.input }}
- name: Send notification on failure
if: ${{ failure() }}
uses: actions-cool/issues-helper@v3
with:
actions: create-issue
token: ${{ secrets.GITHUB_TOKEN }}
title: Update of ${{ matrix.template }} ${{ matrix.input }} failure
body: The [${{ github.workflow }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) workflow failed. Check the workflow run for details.
labels: automated