Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/android-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
branches: [main, master]
workflow_dispatch:
permissions:
contents: write
Comment on lines +7 to +8

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.

Suggestion: Granting contents: write at the top level gives write permissions to all jobs and actions in this workflow. To follow the principle of least privilege, set workflow permissions to contents: read and only elevate permissions within specific jobs if write access is required. [security, importance: 8]

Suggested change
permissions:
contents: write
permissions:
contents: read

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1: This grants contents: write to every build step, including npm ci, the build scripts, and third-party actions, although only the conditional release step needs repository write access. Split release into a separate job with contents: write and keep this build job at contents: read so a compromised dependency or action cannot modify the repository.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At .github/workflows/android-build.yml, line 8:

<comment>This grants `contents: write` to every build step, including `npm ci`, the build scripts, and third-party actions, although only the conditional release step needs repository write access. Split release into a separate job with `contents: write` and keep this build job at `contents: read` so a compromised dependency or action cannot modify the repository.</comment>

<file context>
@@ -4,6 +4,8 @@ on:
     branches: [main, master]
   workflow_dispatch:
+permissions:
+  contents: write
 env:
   FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
</file context>

Comment on lines +7 to +8
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

Expand Down
Loading