Skip to content

Update flake inputs and npins #51

Update flake inputs and npins

Update flake inputs and npins #51

Workflow file for this run

---
name: Update
on:
schedule:
- cron: "0 0 1,15 * *" # run on the 1st and 15th of every month
workflow_dispatch:
inputs:
dry-run:
description: "Dry run: if `true`, a pull request will not be made."
type: boolean
required: true
default: false
run-name: Update flake inputs and npins
env:
GIT_USERNAME: github-actions[bot]
GIT_EMAIL: github-actions[bot]@users.noreply.github.com
jobs:
update:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- uses: cachix/install-nix-action@v26
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Configure git
run: nix develop .#ci --impure --command configure-git-user.sh "${{ env.GIT_USERNAME }}" "${{ env.GIT_EMAIL }}"
- name: Update flake inputs
run: |
nix flake update
git commit -am "chore(flake): update inputs"
- name: Update npins
run: |
nix develop .#ci --impure --command npins -d "planet/pkgs/npins" update
nix develop .#ci --impure --command npins -d "planet/pkgs/vim-plugins/npins" update
git commit -am "chore(planet/pkgs): update npins"
- if: ${{ !inputs.dry-run }}
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.PR_PAT }}
branch: update-flake-inputs-and-npins
title: Update flake inputs and npins
body: ${{ github.event_name == 'workflow_dispatch' && 'Manually triggered update.' || 'Automated periodic update.' }}