Skip to content

Commit f7f8b2d

Browse files
authored
Add action documentation (#439)
1 parent 5b6c9f7 commit f7f8b2d

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,41 @@ Try scanning an entire GitHub organization with the following:
147147
docker run -it -v "$PWD:/pwd" trufflesecurity/trufflehog:latest github --org=trufflesecurity
148148
```
149149

150+
### TruffleHog OSS Github Action
151+
152+
```- name: TruffleHog OSS
153+
uses: trufflesecurity/[email protected]
154+
with:
155+
# Repository path
156+
path:
157+
# Start scanning from here (usually main branch).
158+
base:
159+
# Scan commits until here (usually dev branch).
160+
head: # optional
161+
```
162+
163+
The TruffleHog OSS Github Action can be used to scan a range of commits for leaked credentials. The action will fail if
164+
any results are found.
165+
166+
For example, to scan the contents of pull requests you could use the following workflow:
167+
```yaml
168+
name: Leaked Secrets Scan
169+
on: [pull_request]
170+
jobs:
171+
TruffleHog:
172+
runs-on: ubuntu-latest
173+
steps:
174+
- name: Checkout code
175+
uses: actions/checkout@v3
176+
with:
177+
fetch-depth: 0
178+
- name: TruffleHog OSS
179+
uses: trufflesecurity/[email protected]
180+
with:
181+
path: ./
182+
base: ${{ github.event.repository.default_branch }}
183+
head: HEAD
184+
```
150185
151186
## Contributors
152187

0 commit comments

Comments
 (0)