Skip to content

Update

Update #109

Workflow file for this run

---
name: Update
# Put 'on' in quotes to avoid YAML parsing error
"on":
# Enable manual triggering
workflow_dispatch: {}
# Run weekly
schedule:
- cron: "0 0 * * 0"
jobs:
update:
name: Update
# Pin version of Ubuntu to avoid breaking changes
runs-on: ubuntu-22.04
# Use reasonable timeout to avoid stuck workflows
timeout-minutes: 5
env:
NIX_CACHE_DIR: /home/runner/.nixcache
permissions:
# Needed to create branches
contents: write
# Needed to create pull requests
pull-requests: write
steps:
- name: Checkout code
uses: actions/checkout@v3.5.2
- name: Setup Nix cache
uses: actions/cache@v3.3.1
id: cache-nix
with:
path: ${{ env.NIX_CACHE_DIR }}
key: update-nix
- name: Install Nix
uses: cachix/install-nix-action@v21
with:
github_access_token: ${{ github.token }}
install_url: https://releases.nixos.org/nix/nix-2.15.1/install
# See: https://github.com/cachix/install-nix-action/issues/56
- name: Import Nix store cache
if: steps.cache-nix.outputs.cache-hit == 'true'
run: >
nix-store
--import
< ${{ env.NIX_CACHE_DIR }}/archive.nar
- name: Update flake.lock
run: >
nix
develop
.#flake
--command
--
task
flake
- name: Create or update pull request
uses: peter-evans/create-pull-request@v5.0.0
with:
token: ${{ secrets.PAT }}
commit-message: Updated `flake.lock`
title: Updated `flake.lock`
body: |
This pull request updates the `flake.lock` file.
Auto-generated by [`create-pull-request`](https://github.com/peter-evans/create-pull-request).
branch: update-flake-lock
delete-branch: true
labels: dependencies
assignees: ${{ github.repository_owner }}
# See: https://github.com/cachix/install-nix-action/issues/56
- name: Export Nix store cache
if: "!cancelled()"
run: >
mkdir
-p
${{ env.NIX_CACHE_DIR }}
&&
nix-store
--export $(find /nix/store -maxdepth 1 -name '*-*')
> ${{ env.NIX_CACHE_DIR }}/archive.nar