2023-07-29 19:20:14 +00:00
|
|
|
name: Update Flake
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch: # allows manual triggering
|
|
|
|
schedule:
|
|
|
|
- cron: '33 3 * * 0' # runs weekly on Sunday at 03:33
|
|
|
|
|
|
|
|
permissions:
|
2023-07-30 13:37:52 +00:00
|
|
|
contents: write
|
2023-07-30 13:23:29 +00:00
|
|
|
pull-requests: write
|
2023-11-12 04:33:23 +00:00
|
|
|
checks: write
|
2023-07-29 19:20:14 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
lockfile:
|
|
|
|
name: Lockfile
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout Repository
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Install Nix
|
|
|
|
uses: DeterminateSystems/nix-installer-action@v4
|
|
|
|
- name: Check Nixpkgs Inputs
|
|
|
|
uses: DeterminateSystems/flake-checker-action@v5
|
2023-07-30 13:49:53 +00:00
|
|
|
- name: Add Nix Cache
|
|
|
|
uses: DeterminateSystems/magic-nix-cache-action@v2
|
2023-07-29 19:20:14 +00:00
|
|
|
- name: Update flake.lock
|
2023-07-30 13:38:53 +00:00
|
|
|
uses: DeterminateSystems/update-flake-lock@v19
|
2023-07-29 19:20:14 +00:00
|
|
|
id: update
|
|
|
|
with:
|
|
|
|
pr-title: "Update flake.lock" # Title of PR to be created
|
|
|
|
pr-labels: | # Labels to be set on the PR
|
|
|
|
dependencies
|
|
|
|
automated
|
2024-01-28 04:19:54 +00:00
|
|
|
pr-body: |
|
|
|
|
Automated changes by the [update-flake-lock](https://github.com/DeterminateSystems/update-flake-lock) GitHub Action.
|
|
|
|
|
|
|
|
```
|
|
|
|
{{ env.GIT_COMMIT_MESSAGE }}
|
|
|
|
```
|
2023-07-30 13:49:53 +00:00
|
|
|
- name: Check the Flake
|
2023-11-05 12:52:56 +00:00
|
|
|
id: check
|
2023-07-30 13:49:53 +00:00
|
|
|
run: nix flake check
|
2023-11-05 12:52:56 +00:00
|
|
|
- name: Update Check Status
|
|
|
|
uses: LouisBrunner/checks-action@v1.6.1
|
|
|
|
if: always()
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
name: Update Flake
|
|
|
|
conclusion: ${{ job.status }}
|
|
|
|
output: |
|
|
|
|
{"summary":"${{ steps.check.outputs.stdout }}"}
|
2023-07-29 19:20:14 +00:00
|
|
|
- name: Enable Pull Request Automerge
|
2023-09-30 13:35:37 +00:00
|
|
|
if: success()
|
|
|
|
run: |
|
|
|
|
gh pr merge \
|
|
|
|
--rebase \
|
|
|
|
--auto \
|
|
|
|
${{ steps.update.outputs.pull-request-number }}
|
|
|
|
env:
|
|
|
|
GH_TOKEN: ${{ github.token }}
|
|
|
|
- name: Close Pull Request If Failed
|
|
|
|
if: failure()
|
|
|
|
run: |
|
|
|
|
gh pr close \
|
|
|
|
--comment "Auto-closing pull request" \
|
|
|
|
--delete-branch \
|
|
|
|
${{ steps.update.outputs.pull-request-number }}
|
2023-07-30 13:49:53 +00:00
|
|
|
env:
|
|
|
|
GH_TOKEN: ${{ github.token }}
|