Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions scripts/test-zizmor-policy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ fail() {
exit 1
}

# The fixture's lines 13 to 16 are the checkout, the organization action, the
# third-party action and the injected run step.
# The fixture's lines 13 to 17 are the checkout, the two organizations' actions,
# the third-party action and the injected run step.
expect_reported() {
if ! grep -Eq "^ +$1:[0-9]+ .*zizmor/$2" <<< "${scan_output}"; then
fail "Expected zizmor to report $2 on line $1."
Expand All @@ -55,10 +55,11 @@ expect_silent() {

# A third-party tag and an injected expression must still be reported, or a
# green run would prove nothing.
expect_reported 15 unpinned-uses
expect_reported 16 template-injection
expect_reported 16 unpinned-uses
expect_reported 17 template-injection

# The shared policy lets GitHub's and this organization's actions keep a tag,
# The shared policy lets GitHub's and both organizations' actions keep a tag,
# and turns off the checkout credential audit.
expect_silent 13
expect_silent 14
expect_silent 15
1 change: 1 addition & 0 deletions security/zizmor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ rules:
actions/*: ref-pin
github/*: ref-pin
sinemacula/*: ref-pin
gigly-inc/*: ref-pin
'*': hash-pin

# Flags every checkout that keeps its token, which release and deploy jobs
Expand Down
1 change: 1 addition & 0 deletions tests/zizmor-consumer/Fixtures/audit.yml.fixture
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ jobs:
steps:
- uses: actions/checkout@v5
- uses: sinemacula/example-action@v1
- uses: gigly-inc/example-action@v1
- uses: example-vendor/example-action@v1
- run: echo "${{ github.event.pull_request.title }}"
Loading