Skip to content

Conversation

@niStee
Copy link

@niStee niStee commented Jan 2, 2026

I've noticed several workflows are running with default permissions and relying on a custom WORKFLOW_TOKEN. This PR refactors some to follow the principle of least privilege.

Changes:

Permissions Hardening: Added permissions: contents: read to all workflow headers.

Token Standardization: Migrated build-prs.yml and flatpak-build.yml from secrets.WORKFLOW_TOKEN to the built-in secrets.GITHUB_TOKEN.

Technical Considerations:

  1. Security: Explicitly setting contents: read mitigates potential write-access exploits from compromised dependencies in the build chain.
  2. Token Scope: Is there a specific architectural reason for using WORKFLOW_TOKEN in these files? If the built-in GITHUB_TOKEN provides the necessary scope for PR builds and artifact generation, it seems more logical to use the automatically rotated, short-lived secret.

A question on the build logic: I have applied contents: read based on the assumption that these workflows are used for validation and artifact storage. If pnpm dist or the Flatpak builder requires pushing tags or updating releases via the API, these will fail with a 403.

Does our current CI flow require write access for these automated checks, or is the restrictive "read-only" state the intended baseline?


Infrastructure / CI Changes

  • Verified workflow syntax.
  • Tested actual execution (to be confirmed by CI run).

Note: This PR does not modify Backend or Frontend logic, so standard app testing (Login/Install/Play) was not performed. The primary risk is CI permission scoping.

Copy link
Member

@CommandMC CommandMC left a comment

Choose a reason for hiding this comment

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

If pnpm dist or the Flatpak builder requires pushing tags or updating releases via the API, these will fail with a 403

These operations should run fine with the more limited permissions
In general though, you may want to look into what those commands/workflows do, instead of moving that burden to us (understand these workflows were setup years ago, I'd have to re-familiarize myself with them as well)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants