Skip to content

ci: Refine permissions#393

Merged
jfly merged 2 commits into
NixOS:masterfrom
LeSuisse:ci-adjust-permissions
May 20, 2026
Merged

ci: Refine permissions#393
jfly merged 2 commits into
NixOS:masterfrom
LeSuisse:ci-adjust-permissions

Conversation

@LeSuisse
Copy link
Copy Markdown
Member

No need to request credentials/permissions that are not absolutely needed.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 20, 2026

Nixpkgs diff

Copy link
Copy Markdown
Contributor

@MattSturgeon MattSturgeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. LMK what you think of the optional feedback; whether you agree or disagree and whether you want to address any of it in this PR or not.

Comment on lines -85 to -89
- uses: cachix/cachix-action@5f2d7c5294214f71b873db4b969586b980625e71 # v17
with:
name: nixos-nixfmt
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be nice to keep this on push events, or even have it without the authToken on pull_request_target events.

Something like

authToken: ${{ github.event_name == 'push' && secrets.CACHIX_AUTH_TOKEN || '' }}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking thoughts:

  • How does magic-nix-cache handle this?
  • Does Cachix have a recommendation about how to do this safely? It doesn't seem crazy to want evolving PRs to avoid rebuilds.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My preference is still to keep cachix-action here, but only providing authToken in trusted contexts (like push events).

IIRC, cachix-action will continue to function read-only when configured without a token.

If debate will delay this PR unnecessarily, then I'm happy to deal with that in a dedicated "restore cachix" PR.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If debate will delay this PR unnecessarily, then I'm happy to deal with that in a dedicated "restore cachix" PR.

It will not! Let's discuss in #394

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to merge this as is. @MattSturgeon, feel free to tweak the logic so we (safely) push more things to the cache.

Comment thread .github/workflows/main.yml
Comment thread .github/workflows/main.yml Outdated
Comment thread .github/workflows/main.yml Outdated
@LeSuisse LeSuisse force-pushed the ci-adjust-permissions branch from e32aded to d77a5e6 Compare May 20, 2026 14:44
@LeSuisse
Copy link
Copy Markdown
Member Author

Made some adjustments to the comment, tell me if it looks OK.

@mdaniels5757 I added myself as co-author to take responsibility if someone needs to be yelled at in the future if the comments are wrong 😅

Copy link
Copy Markdown
Collaborator

@jfly jfly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but will wait for @MattSturgeon to take another look before merging.

Comment thread .github/workflows/main.yml Outdated
Comment thread .github/workflows/main.yml Outdated
@jfly jfly force-pushed the ci-adjust-permissions branch from 4d731d9 to 903898a Compare May 20, 2026 21:13
@jfly jfly enabled auto-merge May 20, 2026 21:14
@jfly jfly merged commit 0167b82 into NixOS:master May 20, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants