Skip to content

Backport workflow-hardening fix (excessive-permissions) to 5 release branches #487

Closed

Description

@CharlieMCY

Summary

The default branch already hardened .github/workflows/sca-scan.yaml against the issue(s) below, but 5 release branches still carry it. This proposes the same, minimal, scanner-verified fix for each.

What's flagged (by zizmor)

  • excessive-permissions — workflow/job granted broader permissions than needed

Already resolved on the default branch in:

Affected release branches (5)

  • 0.7.5 (still present as of HEAD 0b792e3f)
  • 0.6.x (still present as of HEAD 7a59490c)
  • 0.7.6 (still present as of HEAD 03e9344d)
  • 0.7.3 (still present as of HEAD 8950e764)
  • 0.7.4 (still present as of HEAD 2fa14238)

Suggested per-branch patches

Each diff below was checked locally with zizmor and actionlint: the flagged finding(s) are cleared on the affected construct and no new lint or security findings are introduced. (Whitespace is normalized; only security-relevant lines change.)

0.7.5 — excessive-permissions

File .github/workflows/sca-scan.yaml; suggested edits:

    • jobs.$J.permissions.contents = 'write'
--- a/.github/workflows/sca-scan.yaml
+++ b/.github/workflows/sca-scan.yaml
@@ -110,3 +110,5 @@
           pr_number=$(gh pr list --state open --limit 1 --json number --jq '.[0].number')
           gh pr merge $pr_number --merge --admin
         shell: bash
+    permissions:
+      contents: write
0.6.x — excessive-permissions

File .github/workflows/sca-scan.yaml; suggested edits:

    • jobs.$J.permissions.contents = 'write'
--- a/.github/workflows/sca-scan.yaml
+++ b/.github/workflows/sca-scan.yaml
@@ -110,3 +110,5 @@
           pr_number=$(gh pr list --state open --limit 1 --json number --jq '.[0].number')
           gh pr merge $pr_number --merge --admin
         shell: bash
+    permissions:
+      contents: write
0.7.6 — excessive-permissions

File .github/workflows/sca-scan.yaml; suggested edits:

    • jobs.$J.permissions.contents = 'write'
--- a/.github/workflows/sca-scan.yaml
+++ b/.github/workflows/sca-scan.yaml
@@ -110,3 +110,5 @@
           pr_number=$(gh pr list --state open --limit 1 --json number --jq '.[0].number')
           gh pr merge $pr_number --merge --admin
         shell: bash
+    permissions:
+      contents: write
0.7.3 — excessive-permissions

File .github/workflows/sca-scan.yaml; suggested edits:

    • jobs.$J.permissions.contents = 'write'
--- a/.github/workflows/sca-scan.yaml
+++ b/.github/workflows/sca-scan.yaml
@@ -110,3 +110,5 @@
           pr_number=$(gh pr list --state open --limit 1 --json number --jq '.[0].number')
           gh pr merge $pr_number --merge --admin
         shell: bash
+    permissions:
+      contents: write
0.7.4 — excessive-permissions

File .github/workflows/sca-scan.yaml; suggested edits:

    • jobs.$J.permissions.contents = 'write'
--- a/.github/workflows/sca-scan.yaml
+++ b/.github/workflows/sca-scan.yaml
@@ -110,3 +110,5 @@
           pr_number=$(gh pr list --state open --limit 1 --json number --jq '.[0].number')
           gh pr merge $pr_number --merge --admin
         shell: bash
+    permissions:
+      contents: write

Happy to open pull requests instead if that's preferred.

Activity

  1. aivf-kaydenyip commented on Jul 24, 2026

    @aivf-kaydenyip
    Collaborator

    Hi @CharlieMCY, thank you for your suggestion but we no longer rely on .github/workflows/sca-scan.yaml workflow, therefore there is no need to patch earlier branch versions.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions