Skip to content

Commit 6eac0e5

Browse files
authored
fix: skip zizmor scan on PRs with no workflow changes (#11)
Fix the skipping logic for `zizmor-scan` to ensure that for all Pull Request events (both `pull_request` and `pull_request_target`), the job is skipped if no workflow files have changed, even if `wif_provider` is provided as an input. Non-PR events (like `push` or `schedule`) will still run if `wif_provider` is set.
1 parent f0f768e commit 6eac0e5

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

.github/workflows/github_actions_scan.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,13 @@ jobs:
4646
needs: ['check-changes']
4747
runs-on: 'ubuntu-latest'
4848
if: >-
49-
inputs.wif_provider != '' ||
49+
needs.check-changes.outputs.files != '' &&
5050
(
51-
needs.check-changes.outputs.files != '' &&
52-
github.event_name == 'pull_request_target' &&
53-
!startsWith(github.workflow_ref, format('{0}/', github.repository))
51+
inputs.wif_provider != '' ||
52+
(
53+
github.event_name == 'pull_request_target' &&
54+
!startsWith(github.workflow_ref, format('{0}/', github.repository))
55+
)
5456
)
5557
permissions:
5658
contents: 'read'

0 commit comments

Comments
 (0)