forked from LovelaceAcademy/nix-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (54 loc) · 2.13 KB
/
update-flake-lock-inputs.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.BOT_APP_ID }}
private_key: ${{ secrets.BOT_PRIVATE_KEY }}
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@V27
with:
extra_nix_config: |
accept-flake-config = true
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Update ${{ matrix.template }} flake.lock ${{ matrix.input }}
uses: DeterminateSystems/update-flake-lock@v23
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