-
Notifications
You must be signed in to change notification settings - Fork 48
37 lines (32 loc) · 1015 Bytes
/
security.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Security Checks
on:
push:
permissions:
contents: read
jobs:
trufflehog:
runs-on: ubuntu-latest
steps:
- shell: bash
run: |
if [ "$EVENT_NAME" == "push" ]; then
echo "depth=$(($(jq length <<< $COMMITS)+2))" >> $GITHUB_ENV
echo "branch=$REF" >> $GITHUB_ENV
fi
if [ "$EVENT_NAME" == "pull_request" ]; then
echo "depth=$(($PR_COMMITS+2))" >> $GITHUB_ENV
echo "branch=$PR_REF" >> $GITHUB_ENV
fi
env:
REF: ${{ github.ref_name }}
COMMITS: ${{ tojson(github.event.commits) }}
EVENT_NAME: ${{ github.event_name }}
PR_REF: ${{ github.event.pull_request.head.ref }}
PR_COMMITS: ${{ github.event.pull_request.commits }}
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{env.branch}}
fetch-depth: ${{env.depth}}
- name: Scan for secrets
uses: trufflesecurity/trufflehog@main