Skip to content

update-flake-lock

update-flake-lock #10

---
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: update-flake-lock
on:
workflow_dispatch:
# schedule:
# - cron: '37 0 * * *'
permissions:
actions: write
contents: write
pull-requests: write
jobs:
lockfile:
runs-on: ubuntu-latest
steps:
# https://github.com/marketplace/actions/create-github-app-token
- name: Generate Token
uses: actions/create-github-app-token@31c86eb3b33c9b601a1f60f98dcbfd1d70f379b4 # v1.10.3
# if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
id: app-token
with:
app-id: ${{ secrets.BOT_APP_ID }}
private-key: ${{ secrets.BOT_APP_PRIVATE_KEY }}
# https://github.com/marketplace/actions/checkout
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
token: "${{ steps.app-token.outputs.token }}"
# https://github.com/marketplace/actions/the-determinate-nix-installer
- name: Install nix
uses: DeterminateSystems/nix-installer-action@ab6bcb2d5af0e904d04aea750e2089e9dc4cbfdd # v13
# https://github.com/marketplace/actions/magic-nix-cache
- name: Use cache
uses: DeterminateSystems/magic-nix-cache-action@b46e247b898aa56e6d2d2e728dc6df6c84fdb738 # v7
# https://github.com/marketplace/actions/update-nix-flake-lock
- name: Update flake.lock
id: update
uses: DeterminateSystems/update-flake-lock@db4ee38117a597ea8df8f7f75a187dd65093eade # v23
with:
path-to-flake-dir: infra/nixos
token: ${{ steps.app-token.outputs.token }}
# - name: Enable automerge
# if: ${{ steps.update.outputs.pull-request-number != '' }}
# run: gh pr merge --squash --auto ${{ steps.update.outputs.pull-request-number }}
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: diff
run: git diff