-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: github-env: support composite actions (#358)
- Loading branch information
Showing
4 changed files
with
99 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
source: tests/snapshot.rs | ||
expression: "zizmor().workflow(workflow_under_test(\"github-env/action.yml\")).run()?" | ||
snapshot_kind: text | ||
--- | ||
error[github-env]: dangerous use of GITHUB_ENV | ||
--> @@INPUT@@:10:7 | ||
| | ||
10 | / run: | | ||
11 | | echo "foo=$(bar)" >> $GITHUB_ENV | ||
| |________________________________________^ GITHUB_ENV write may allow code execution | ||
| | ||
= note: audit confidence → Low | ||
|
||
error[github-env]: dangerous use of GITHUB_ENV | ||
--> @@INPUT@@:15:7 | ||
| | ||
15 | / run: | | ||
16 | | echo "foo=$env:BAR" >> $env:GITHUB_ENV | ||
| |______________________________________________^ GITHUB_ENV write may allow code execution | ||
| | ||
= note: audit confidence → Low | ||
|
||
error[github-env]: dangerous use of GITHUB_ENV | ||
--> @@INPUT@@:20:7 | ||
| | ||
20 | / run: | | ||
21 | | echo LIBRARY=%LIBRARY% >> %GITHUB_ENV% | ||
| |______________________________________________^ GITHUB_ENV write may allow code execution | ||
| | ||
= note: audit confidence → Low | ||
|
||
3 findings: 0 unknown, 0 informational, 0 low, 0 medium, 3 high |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# demo of a composite action being flagged by github-env | ||
|
||
name: github-env-composite-action | ||
description: github-env-composite-action | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: true-positive-1 | ||
run: | | ||
echo "foo=$(bar)" >> $GITHUB_ENV | ||
shell: bash | ||
|
||
- name: true-positive-2 | ||
run: | | ||
echo "foo=$env:BAR" >> $env:GITHUB_ENV | ||
shell: pwsh | ||
|
||
- name: true-positive-3 | ||
run: | | ||
echo LIBRARY=%LIBRARY% >> %GITHUB_ENV% | ||
shell: cmd | ||
|
||
- name: true-negative-4 | ||
# No finding because foo=bar is wholly static. | ||
run: | | ||
echo foo=bar >> $GITHUB_ENV | ||
shell: bash |