Skip to content

Auto Update Flake Inputs #135

Auto Update Flake Inputs

Auto Update Flake Inputs #135

Workflow file for this run

name: Auto Update Flake Inputs
on:
schedule:
# run this daily at 8am UTC, or roughly 4am eastern
- cron: '30 2 * * 6'
# Allows you to run this workflow manually from the Actions tab
# push:
# branches:
# - master
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
update:
runs-on: ubuntu-latest
steps:
# - uses: styfle/[email protected]
# with:
# access_token: ${{ github.token }}
- uses: actions/checkout@v4
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
- uses: cachix/install-nix-action@v30
with:
# FIXME: https://github.com/NixOS/nix/issues/9889
extra_nix_config: |
experimental-features = nix-command flakes configurable-impure-env auto-allocate-uids
- name: Prepare flakebot branch
run: |
git config --local user.email "[email protected]"
git config --local user.name "flakebot"
git checkout -B flakebot
- name: Update and commit lockfile
# run: nix flake update --commit-lock-file
run: nix run -v --impure .#update
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: flakebot
force: true
- name: pull-request-action
uses: vsoch/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PULL_REQUEST_FROM_BRANCH: 'flakebot'
PULL_REQUEST_BRANCH: 'master'
MAINTAINER_CANT_MODIFY: true
PASS_IF_EXISTS: true
PASS_ON_ERROR: true
PULL_REQUEST_UPDATE: true
PULL_REQUEST_TITLE: 'Update Flake Inputs'
- name: Trigger second workflow
run: |
curl -X POST \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.everest-preview+json" \
https://api.github.com/repos/${{ github.repository }}/dispatches \
-d '{"event_type": "Build-check"}'