nix-dotfiles/.github/workflows/flake-update.yml
ahuston-0 c2dfd86e59
All checks were successful
Check flake.lock / Check health of `flake.lock` (pull_request) Successful in 12s
Check Nix formatting / Perform Nix format checks (pull_request) Successful in 2m34s
Check flake.lock / Check health of `flake.lock` (push) Successful in 13s
Check Nix formatting / Perform Nix format checks (push) Successful in 2m28s
Check Nix flake / Perform Nix flake checks (ubuntu-latest) (push) Successful in 7m6s
Check Nix flake / Perform Nix flake checks (ubuntu-latest) (pull_request) Successful in 6m55s
fix evals
2025-03-03 11:32:00 -05:00

73 lines
2.3 KiB
YAML

name: "Update flakes"
on:
repository_dispatch:
workflow_dispatch:
schedule:
- cron: "00 12 * * *"
jobs:
createPullRequest:
runs-on: ubuntu-latest
# if: github.ref == 'refs/heads/main' # ensure workflow_dispatch only runs on main
steps:
- uses: actions/checkout@v4
# - name: Login to Docker Hub
# uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Install Nix
uses: cachix/install-nix-action@v24
with:
extra_nix_config: |
experimental-features = nix-command flakes
install_url: https://releases.nixos.org/nix/nix-2.19.0/install
- name: Setup Attic cache
uses: ryanccn/attic-action@v0
with:
endpoint: ${{ secrets.ATTIC_ENDPOINT }}
cache: ${{ secrets.ATTIC_CACHE }}
token: ${{ secrets.ATTIC_TOKEN }}
- name: Calculate pre-drv
run: nix run git+https://nayeonie.com/ahuston-0/flake-update-diff -- --keep-hydra .
# - name: Pull latest docker images
# run: nix ./utils/fetch-docker.sh
- name: Update flake.lock (part 1)
run: nix flake update
- name: Calculate post-drv
run: nix run git+https://nayeonie.com/ahuston-0/flake-update-diff -- --keep-hydra .
# - name: Calculate diff
# run: nix ./utils/diff-evals.sh
# - name: Read diff into environment
# run: |
# delimiter="$(openssl rand -hex 8)"
# {
# echo "POSTDIFF<<${delimiter}"
# cat post-diff
# echo "${delimiter}"
# } >> $GITHUB_ENV
- name: Restore flake.lock for next step
run: git restore flake.lock
- name: Update flake.lock
id: update
uses: DeterminateSystems/update-flake-lock@main
with:
token: ${{ secrets.GH_TOKEN_FOR_UPDATES }}
pr-body: |
Automated changes by the [update-flake-lock](https://github.com/DeterminateSystems/update-flake-lock) GitHub Action.
```
{{ env.GIT_COMMIT_MESSAGE }}
```
```
{{ env.POSTDIFF }}
```
pr-labels: | # Labels to be set on the PR
dependencies
automated
permissions:
pull-requests: write
contents: write