Skip to content

Commit fb94974

Browse files
unlobitolachlankidsonwoodruffw
authored
Expose output-file as an output when advanced-security: true (#87)
Co-authored-by: Lachlan Kidson <lachlan.kidson@skyscanner.net> Co-authored-by: William Woodruff <william@yossarian.net>
1 parent 867562a commit fb94974

3 files changed

Lines changed: 37 additions & 0 deletions

File tree

.github/workflows/selftest.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,28 @@ jobs:
207207
inputs: woodruffw-experiments/empty
208208
fail-on-no-inputs: false
209209

210+
selftest-output-file-output-is-present-when-advanced-security:
211+
name: "TEST: 'outputs.output-file' is present when `advanced-security: true`"
212+
runs-on: ubuntu-latest
213+
permissions:
214+
security-events: write
215+
216+
steps:
217+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
218+
with:
219+
persist-credentials: false
220+
221+
- uses: ./
222+
id: zizmor
223+
with:
224+
advanced-security: true
225+
226+
- name: Test output-file
227+
run: |
228+
jq < "${OUTPUT_FILE}"
229+
env:
230+
OUTPUT_FILE: ${{ steps.zizmor.outputs.output-file }}
231+
210232
all-selftests-pass:
211233
if: always()
212234

@@ -221,6 +243,7 @@ jobs:
221243
- selftest-annotations-advanced-security-exclusive-xfail
222244
- selftest-fail-on-no-inputs-xfail
223245
- selftest-fail-on-no-inputs-disabled
246+
- selftest-output-file-output-is-present-when-advanced-security
224247

225248
runs-on: ubuntu-latest
226249

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Run [`zizmor`] from GitHub Actions!
2121
- [`annotations`](#annotations)
2222
- [`color`](#color)
2323
- [`config`](#config)
24+
- [Outputs](#outputs)
2425
- [Permissions](#permissions)
2526
- [Troubleshooting](#troubleshooting)
2627

@@ -276,6 +277,14 @@ succeed even if no inputs were found.
276277
> on earlier versions of `zizmor`, meaning that the action will always fail
277278
> if no inputs are found on earlier versions.
278279

280+
## Outputs
281+
282+
### `output-file`
283+
284+
When `advanced-security: true`, the `output-file` output will contain a filepath
285+
for `zizmor`'s static analysis results in the SARIF format.
286+
287+
279288
## Permissions
280289

281290
`zizmor-action` requires different permissions depending on how you use it.

action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ branding:
55
icon: "shield"
66
color: "blue"
77

8+
outputs:
9+
output-file:
10+
description: Filepath to static analysis results in SARIF format"
11+
value: ${{ steps.run-zizmor.outputs.sarif-file }}
12+
813
inputs:
914
inputs:
1015
description: |

0 commit comments

Comments
 (0)