ci: init auto flake update action #1
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 Inputs | ||
on: | ||
workflow_dispatch: | ||
schedule: | ||
# https://crontab.guru/#0_13_*_*_wed | ||
- cron: "0 13 * * wed" | ||
jobs: | ||
build: | ||
runs-on: nix | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Flake update | ||
run: nix flake update | ||
- name: Set Git user | ||
run: | | ||
git config --global user.name "github-actions[bot]" | ||
git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
- name: Git commit | ||
run: | | ||
git add -A | ||
if [[ `git status --porcelain` ]]; then | ||
git commit -m "flake: update inputs" | ||
else | ||
echo "Inputs all up to date" | ||
fi | ||
- name: Create pull request | ||
run: gh pr create -H main --title "Bot: flake update" --body "Weekly update :3" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |