[Nix] CI Fixes for nix flake check
#552
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
There are two changes here:
nix flake checkis triggered by changes to any .nix filenix flake checkruns against the most recent commits to the current branch (currently runs against the base branch used to create the PR)Type of change
Related Issue(s)
How To Test
I don't have the permissions to test this myself, but theoretically a maintainer can test this by doing the following:
nix flake checkto fail locally in the filenix/shell-plugins.nixnix flake checkdoes not trigger (you can check this here)'**.nix'from this PR, and observe here) again that now there should be a successful run ofnix flake check(even though we are expecting an error. This occurs because they are essentially run againstmainrather than the current branch's most recent commits).pull_request), and watch as the checks now should run against the most recent commit on this branch. We now expect them to failnix flake check, like it does locally.nix flake checkto fail, and watch as the checks should run successfully.Note: the above test may not work, as sometimes GitHub PRs won't allow the actions to be updated until after the PR is merged, so if there are any issues this should be considered as well.
A maintainer can run this action manually in order for the checks on this PR to pass: https://github.com/1Password/shell-plugins/actions/runs/17350571621 (or see "workflow awaiting approval" at the bottom of this PR description page where the CI checks are shown).
Changelog
GitHub CI for
nix flake checknow triggers for any.nixfile, not just the ones in the project root. Additionally, it now tests the most recent commits on the current branch rather than the branch the PR is based from.