Backport workflow-hardening fix (excessive-permissions) to 4 release branches
- Dominant language
- Java
- Stars
- 22.6k
- Forks
- 12k
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 27
Description
### Summary
The default branch already hardened `.github/workflows/bazel.yml` against the issue(s) below, but **4** release branches still carry it. This proposes the same, minimal, scanner-verified fix for each.
### What's flagged (by [zizmor](https://github.com/woodruffw/zizmor))
- `excessive-permissions` — workflow/job granted broader `permissions` than needed
Already resolved on the default branch in:
- https://github.com/apache/rocketmq/commit/18f5f28af5c908d2d9986bbd824f237be9baf5e9
### Affected release branches (4)
- **`release-5.4.0`** (still present as of HEAD `b5da00ad`)
- **`release-5.3.4`** (still present as of HEAD `63d20eb9`)
- **`release-5.3.3`** (still present as of HEAD `29d90a4f`)
- **`release-5.3.2`** (still present as of HEAD `2baaf044`)
### 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.)
release-5.4.0 — excessive-permissions
File `.github/workflows/bazel.yml`; suggested edits:
- + permissions.actions = 'write'
```diff
--- a/.github/workflows/bazel.yml
+++ b/.github/workflows/bazel.yml
@@ -21,3 +21,5 @@
run: bazel build --config=remote //...
- name: Run Tests
run: bazel test --config=remote //...
+permissions:
+ actions: write
```
release-5.3.4 — excessive-permissions
File `.github/workflows/bazel.yml`; suggested edits:
- + permissions.actions = 'write'
```diff
--- a/.github/workflows/bazel.yml
+++ b/.github/workflows/bazel.yml
@@ -21,3 +21,5 @@
run: bazel build --config=remote //...
- name: Run Tests
run: bazel test --config=remote //...
+permissions:
+ actions: write
```
release-5.3.3 — excessive-permissions
File `.github/workflows/bazel.yml`; suggested edits:
- + permissions.actions = 'write'
```diff
--- a/.github/workflows/bazel.yml
+++ b/.github/workflows/bazel.yml
@@ -21,3 +21,5 @@
run: bazel build --config=remote //...
- name: Run Tests
run: bazel test --config=remote //...
+permissions:
+ actions: write
```
release-5.3.2 — excessive-permissions
File `.github/workflows/bazel.yml`; suggested edits:
- + permissions.actions = 'write'
```diff
--- a/.github/workflows/bazel.yml
+++ b/.github/workflows/bazel.yml
@@ -21,3 +21,5 @@
run: bazel build --config=remote //...
- name: Run Tests
run: bazel test --config=remote //...
+permissions:
+ actions: write
```
---
*Happy to open pull requests instead if that's preferred.*
Contributor guide
Research direction
Review .github/workflows/bazel.yml on release-5.4.0, release-5.3.4, release-5.3.3, and release-5.3.2, comparing each with commit 18f5f28af5c908d2d9986bbd824f237be9baf5e9. Run zizmor and actionlint for each branch; done means the excessive-permissions finding is cleared without new findings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, yaml
- Domain
- ci-cd, security
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- Half a day
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 74/100