Skip to content

update-flake-lock

update-flake-lock #9

---
# 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@a0de6af83968303c8c955486bf9739a57d23c7f1 # v1.10.0
# 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@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
token: "${{ steps.app-token.outputs.token }}"
# https://github.com/marketplace/actions/the-determinate-nix-installer
- name: Install nix
uses: DeterminateSystems/nix-installer-action@8cdf194da984e4f12b2f8c36d1fa107c1dd67f5c # v11
# https://github.com/marketplace/actions/magic-nix-cache
- name: Use cache
uses: DeterminateSystems/magic-nix-cache-action@87e8236f46702ab0ce5a058b605a173ec88d618e # v6
# https://github.com/marketplace/actions/update-nix-flake-lock
- name: Update flake.lock
id: update
uses: DeterminateSystems/update-flake-lock@a3ccb8f59719c48d6423e97744560221bcf7a3fa # v21
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