Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workflow for PR run checks to manage secret usage #71

Merged
merged 13 commits into from
Mar 8, 2024
20 changes: 20 additions & 0 deletions .github/workflows/check-run.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Check PR run

on:
pull_request_target:
types: [opened, synchronize]
workflow_call:

permissions: read-all

jobs:
check:
name: Check
runs-on: ubuntu-22.04

steps:
- name: Check access
if: ${{ github.event.pull_request.author_association != 'COLLABORATOR' && github.event.pull_request.author_association != 'OWNER' }}
withinfocus marked this conversation as resolved.
Show resolved Hide resolved
run: |
echo "Event not triggered by a collaborator."
exit 1
7 changes: 7 additions & 0 deletions .github/workflows/scan.yml
withinfocus marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,15 @@ on:
permissions: read-all

jobs:
check-run:
name: Check PR run
if: github.event_name == 'pull_request'
uses: ./.github/workflows/check-run.yml

sast:
name: SAST scan
runs-on: ubuntu-22.04
needs: check-run
permissions:
security-events: write

Expand Down Expand Up @@ -42,6 +48,7 @@ jobs:
quality:
name: Quality scan
runs-on: ubuntu-22.04
needs: check-run

steps:
- name: Check out repo
Expand Down