-
-
Notifications
You must be signed in to change notification settings - Fork 178
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 Nix Flake Update GitHub workflow to keep flake inputs updated #520
base: master
Are you sure you want to change the base?
ci: add Nix Flake Update GitHub workflow to keep flake inputs updated #520
Conversation
nix flake update
GitHub workflow to keep flake inputs updated8793f7e
to
29d97f4
Compare
This change requires GitHub workflows to have read and write permissions [1] [2]. [1]: DeterminateSystems/update-flake-lock#75 [2]: DeterminateSystems/update-flake-lock#88 Link: danth#520
Bump dependencies:
|
This change requires GitHub workflows to have read and write permissions [1] [2]. [1]: DeterminateSystems/update-flake-lock#75 [2]: DeterminateSystems/update-flake-lock#88 Link: danth#520
29d97f4
to
706c8ef
Compare
Changelogv1: 706c8ef
v0: 29d97f4 |
This change requires GitHub workflows to have read and write permissions [1] [2]. [1]: DeterminateSystems/update-flake-lock#75 [2]: DeterminateSystems/update-flake-lock#88 Link: danth#520
706c8ef
to
4be09d0
Compare
Changelogv2: 4be09d0
v1: 706c8ef
v0: 29d97f4 |
Considering that #519 is taking longer than expected to get merged, we might want to already merge this PR. Consequently, I moved this PR out of draft mode. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use the GitHub App from #664 to allow GitHub Actions to run on the created pull request.
This change requires GitHub workflows to have read and write permissions [1] [2]. [1]: DeterminateSystems/update-flake-lock#75 [2]: DeterminateSystems/update-flake-lock#88 Link: danth#520
- uses: DeterminateSystems/update-flake-lock@v24 | ||
with: | ||
pr-labels: dependencies | ||
pr-title: "stylix: update all flake inputs" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use the GitHub App from #664 to allow GitHub Actions to run on the created pull request.
Upstream suggests adding an authentication token:
With a Personal Authentication Token
By providing a Personal Authentication Token, the PR will be submitted in a way that bypasses this limitation (GitHub will essentially think it is the owner of the PAT submitting the PR, and not an Action).
You can create a token by visiting https://github.com/settings/tokens and select at least therepo
scope. For the new fine-grained tokens, you need to enable read and write access for "Contents" and "Pull Requests" permissions. Then, store this token in your repository secrets (i.e.https://github.com/<USER>/<REPO>/settings/secrets/actions
) asGH_TOKEN_FOR_UPDATES
and set up your workflow file like the following:name: update-flake-lock on: workflow_dispatch: # allows manual triggering schedule: - cron: '0 0 * * 1,4' # Run twice a week jobs: lockfile: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 - name: Install Nix uses: DeterminateSystems/nix-installer-action@v1 - name: Update flake.lock uses: DeterminateSystems/update-flake-lock@vX with: token: ${{ secrets.GH_TOKEN_FOR_UPDATES }}
I assume we have to add the following and properly setup secrets.GH_TOKEN_UPDATE_FLAKE_LOCK
:
pr-title: "stylix: update all flake inputs" | |
pr-title: "stylix: update all flake inputs" | |
token: ${{ secrets.GH_TOKEN_UPDATE_FLAKE_LOCK }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the app token functions the same as a PAT, except that any actions taken by it use the identity of the app rather than a personal account.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the app token functions the same as a PAT, except that any actions taken by it use the identity of the app rather than a personal account.
Which of the two approaches should we use? I assume following upstream instructions might be more reliable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer the app approach as otherwise, the flake update pull requests would appear as if I created them myself, which I think is misleading. That might skew the contributors chart as well.
For reference, the app currently has the following permissions on the repository:
This change requires GitHub workflows to have read and write permissions 1 2.
This PR is stacked on top of the pending patchset #519 ("treewide: add developer shell and pre-commit hooks and simplify GitHub workflows") and should only be merged after it. Although ready for review, this PR will remain in Draft status until patchset "treewide: add developer shell and pre-commit hooks and simplify GitHub workflows" is merged.