Skip to content

Commit 39d7f85

Browse files
committed
ci: Check if GHAS is enabled.
1 parent f9f5fb0 commit 39d7f85

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

.github/workflows/branch.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,14 @@ jobs:
9595
steps:
9696
- name: Checkout source code
9797
uses: actions/checkout@v4
98+
- name: GHAS not enabled warning
99+
if: ${{ !github.event.repository.security_and_analysis.advanced_security_enabled && github.event.repository.private }}
100+
run: |
101+
echo "Warning: GitHub Advanced Security is not enabled. Please enable it to upload SARIF results."
102+
- name: GHAS enabled notice
103+
if: ${{ github.event.repository.security_and_analysis.advanced_security_enabled || !github.event.repository.private }}
104+
run: |
105+
echo "GitHub Advanced Security is enabled. SARIF results will be uploaded to the Security tab on the main branch."
98106
- name: Run Trivy vulnerability scanner
99107
uses: aquasecurity/[email protected]
100108
with:

0 commit comments

Comments
 (0)