2.home-manager/.github/workflows/update-flake.yml
Austin Horstman 951f0b30c5
ci: schedule release flake lock updates (#7325)
Currently only running on the master branch. But, we can schedule on the
release branch, as well.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2025-06-24 14:54:56 -05:00

61 lines
2.1 KiB
YAML

name: Update flake inputs
on:
schedule:
# Update every Sunday and Wednesday
- cron: "51 3 * * 0,3"
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
if: github.event_name != 'schedule' || github.repository_owner == 'nix-community'
strategy:
matrix:
branch: [master, release-25.05]
steps:
- name: Create GitHub App token
uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ vars.CI_APP_ID }}
private-key: ${{ secrets.CI_APP_PRIVATE_KEY }}
- name: Get GitHub App user info
id: user-info
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
slug: ${{ steps.app-token.outputs.app-slug }}
run: |
name="$slug[bot]"
id=$(gh api "/users/$name" --jq .id)
{
echo "id=$id"
echo "name=$name"
echo "email=$id+$name@users.noreply.github.com"
} >> "$GITHUB_OUTPUT"
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
- name: Install Nix
uses: cachix/install-nix-action@v31
- name: Update flake.lock
uses: DeterminateSystems/update-flake-lock@v25
with:
token: ${{ steps.app-token.outputs.token }}
git-committer-name: ${{ steps.user-info.outputs.name }}
git-committer-email: ${{ steps.user-info.outputs.email }}
git-author-name: ${{ steps.user-info.outputs.name }}
git-author-email: ${{ steps.user-info.outputs.email }}
pr-labels: dependencies
pr-body: |
Automated update by the [update-flake-lock] GitHub Action.
```
{{ env.GIT_COMMIT_MESSAGE }}
```
This PR was most recently updated by workflow run [${{ github.run_id }}].
[update-flake-lock]: https://github.com/DeterminateSystems/update-flake-lock
[${{ github.run_id }}]: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
base-branch: ${{ matrix.branch }}