update-flake-lock #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: update-flake-lock | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 9 * * 1' # Runs weekly on Monday at 9:00am | |
jobs: | |
lockfile: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Install Nix | |
uses: DeterminateSystems/nix-installer-action@main | |
- name: Update All flake.lock Files | |
run: | | |
nix flake update --accept-flake-config | |
cd "$GITHUB_WORKSPACE/templates/haskell" | |
nix flake update --accept-flake-config | |
cd "$GITHUB_WORKSPACE/templates/vanilla" | |
nix flake update --accept-flake-config | |
cd "$GITHUB_WORKSPACE" | |
git add . | |
- name: Create Pull Request | |
id: cpr | |
uses: peter-evans/create-pull-request@v3 | |
with: | |
title: Weekly Update of All flake.lock Files | |
commit-message: Weekly Update of All flake.lock Files | |
delete-branch: true | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Enable Pull Request Auto-Merge | |
if: steps.cpr.outputs.pull-request-operation == 'created' | |
uses: peter-evans/enable-pull-request-automerge@v3 | |
with: | |
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }} | |
merge-method: squash | |
token: ${{ secrets.GITHUB_TOKEN }} |