huggingface / huggingface/diffusers
Backport workflow-hardening fix (excessive-permissions) to 3 release branches
- Dominant language
- Python
- Stars
- 34.5k
- Forks
- 7.3k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 91
Description
### Summary
The default branch already hardened `.github/workflows/stale.yml` against the issue(s) below, but **3** 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/huggingface/diffusers/commit/48e36353d8cbf0322ec1ad0684b95d11f70af2de
### Affected release branches (3)
- **`stable-cascade-dtype`** (still present as of HEAD `327d8e5a`)
- **`release-tests`** (still present as of HEAD `7ef1df4a`)
- **`stable-cascade-upcasting`** (still present as of HEAD `1ca9acc2`)
### 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.)
stable-cascade-dtype — excessive-permissions
File `.github/workflows/stale.yml`; suggested edits:
- + jobs.$J.permissions.issues = 'write'
- + jobs.$J.permissions.pull-requests = 'write'
```diff
--- a/.github/workflows/stale.yml
+++ b/.github/workflows/stale.yml
@@ -25,3 +25,6 @@
- name: Close stale issues
run: |
python utils/stale.py
+ permissions:
+ issues: write
+ pull-requests: write
```
release-tests — excessive-permissions
File `.github/workflows/stale.yml`; suggested edits:
- + jobs.$J.permissions.issues = 'write'
- + jobs.$J.permissions.pull-requests = 'write'
```diff
--- a/.github/workflows/stale.yml
+++ b/.github/workflows/stale.yml
@@ -25,3 +25,6 @@
- name: Close stale issues
run: |
python utils/stale.py
+ permissions:
+ issues: write
+ pull-requests: write
```
stable-cascade-upcasting — excessive-permissions
File `.github/workflows/stale.yml`; suggested edits:
- + jobs.$J.permissions.issues = 'write'
- + jobs.$J.permissions.pull-requests = 'write'
```diff
--- a/.github/workflows/stale.yml
+++ b/.github/workflows/stale.yml
@@ -25,3 +25,6 @@
- name: Close stale issues
run: |
python utils/stale.py
+ permissions:
+ issues: write
+ pull-requests: write
```
---
*Happy to open pull requests instead if that's preferred.*
Contributor guide
Research direction
Apply the suggested change to .github/workflows/stale.yml on stable-cascade-dtype, release-tests, and stable-cascade-upcasting. Start by comparing each branch with the default-branch fix, then run zizmor and actionlint for each workflow. Done means the excessive-permissions finding is cleared without new findings on all three branches.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, python
- Domain
- ci-cd, security
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 85/100