Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: add workflow to update flake.lock #317

Merged
merged 5 commits into from
Jun 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/flake-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: flake-update

on:
workflow_dispatch:
inputs:
branch:
description: "branch"
type: "string"
default: "dev"

jobs:
flake-update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- uses: DeterminateSystems/nix-installer-action@v12
- name: update `flake.lock`
run: nix flake update
- name: commit
run: |
[[ $(git diff) != "" ]] || exit 0
COMMITTER=$(curl "https://api.github.com/search/commits?q=author:${{ github.actor }}&sort=author-date&order=desc&page=1" | jq '.items[0].commit.committer')
NAME=$(echo "$COMMITTER" | jq '.name')
EMAIL=$(echo "$COMMITTER" | jq '.email')
git config --local user.name "$NAME"
git config --local user.email "$EMAIL"
git add flake.lock
git commit -m "update \`flake.lock\`"
- uses: ad-m/github-push-action@master
with:
branch: ${{ inputs.branch }}
Loading