Skip to content

Commit 1a1bf15

Browse files
Add five more cases of superfluous actions and recommend their replacements (#1937)
* Add two actions-ecosystem actions * Suggest replacing `sergeysova/jq-action` with `jq` * Add variants of "git commit"-like actions
1 parent e8a2bb8 commit 1a1bf15

3 files changed

Lines changed: 55 additions & 0 deletions

File tree

crates/zizmor/src/audit/superfluous_actions.rs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,18 @@ static SUPERFLUOUS_ACTIONS: LazyLock<Vec<(RepositoryUsesPattern, &str, Persona,
9090
Persona::Regular,
9191
Confidence::High,
9292
),
93+
(
94+
"actions-ecosystem/action-add-labels".parse().unwrap(),
95+
"use `gh issue edit --add-label` or `gh pr edit --add-label` in a script step",
96+
Persona::Regular,
97+
Confidence::High,
98+
),
99+
(
100+
"actions-ecosystem/action-remove-labels".parse().unwrap(),
101+
"use `gh issue edit --remove-label` or `gh pr edit --remove-label` in a script step",
102+
Persona::Regular,
103+
Confidence::High,
104+
),
93105
(
94106
"svenstaro/upload-release-action".parse().unwrap(),
95107
"use `gh release create` and `gh release upload` in a script step",
@@ -102,6 +114,12 @@ static SUPERFLUOUS_ACTIONS: LazyLock<Vec<(RepositoryUsesPattern, &str, Persona,
102114
Persona::Regular,
103115
Confidence::High,
104116
),
117+
(
118+
"sergeysova/jq-action".parse().unwrap(),
119+
"use `jq` in a script step",
120+
Persona::Regular,
121+
Confidence::High,
122+
),
105123
(
106124
"dtolnay/rust-toolchain".parse().unwrap(),
107125
"use `rustup` and/or `cargo` in a script step",
@@ -112,6 +130,24 @@ static SUPERFLUOUS_ACTIONS: LazyLock<Vec<(RepositoryUsesPattern, &str, Persona,
112130
Persona::Pedantic,
113131
Confidence::Medium,
114132
),
133+
(
134+
"stefanzweifel/git-auto-commit-action".parse().unwrap(),
135+
"use `git add`, `git commit`, and `git push` in a script step",
136+
// NOTE: Currently pedantic because replicating this action's
137+
// full behaviour (empty commit detection, auth setup, etc.)
138+
// requires multiple git commands and some care.
139+
Persona::Pedantic,
140+
Confidence::Low,
141+
),
142+
(
143+
"EndBug/add-and-commit".parse().unwrap(),
144+
"use `git add`, `git commit`, and `git push` in a script step",
145+
// NOTE: Currently pedantic because replicating this action's
146+
// full behaviour (empty commit detection, auth setup, etc.)
147+
// requires multiple git commands and some care.
148+
Persona::Pedantic,
149+
Confidence::Low,
150+
),
115151
]
116152
});
117153

docs/audits.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1605,9 +1605,14 @@ The following table lists some common superfluous actions and their recommended
16051605
| @peter-evans/create-pull-request | `gh pr create` |
16061606
| @peter-evans/create-or-update-comment | `gh pr comment` or `gh issue comment` |
16071607
| @dacbd/create-issue-action | `gh issue create` |
1608+
| @actions-ecosystem/action-add-labels | `gh issue edit --add-label` or `gh pr edit --add-label` |
1609+
| @actions-ecosystem/action-remove-labels | `gh issue edit --remove-label` or `gh pr edit --remove-label` |
16081610
| @svenstaro/upload-release-action | `gh release create` and `gh release upload` |
16091611
| @addnab/docker-run-action | `docker run` |
1612+
| @sergeysova/jq-action | `jq <...>` |
16101613
| @dtolnay/rust-toolchain | `rustup` |
1614+
| @stefanzweifel/git-auto-commit-action | `git add`, `git commit`, and `git push` |
1615+
| @EndBug/add-and-commit | `git add`, `git commit`, and `git push` |
16111616

16121617
!!! example
16131618

docs/release-notes.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,20 @@ of `zizmor`.
2727

2828
### Enhancements
2929

30+
* Recommend `gh issue edit --add-label` / `gh pr edit --add-label` as a replacement for
31+
@actions-ecosystem/action-add-labels in [superfluous-actions]
32+
33+
* Recommend `gh issue edit --remove-label` / `gh pr edit --remove-label` as a replacement for
34+
@actions-ecosystem/action-remove-labels in [superfluous-actions]
35+
36+
* Recommend `jq` as a replacement for @sergeysova/jq-action in [superfluous-actions]
37+
38+
* Recommend `git add`, `git commit`, and `git push` as a replacement for
39+
@stefanzweifel/git-auto-commit-action in [superfluous-actions]
40+
41+
* Recommend `git add`, `git commit`, and `git push` as a replacement for
42+
@EndBug/add-and-commit in [superfluous-actions]
43+
3044
* @tibdex/github-app-token is now recognized as an archived action by
3145
[archived-uses] (#1910)
3246

0 commit comments

Comments
 (0)