Skip to content

Find, verify, and analyze leaked credentials

Add github action (#295)

Bill Richecd6da07ea7a
diff --git a/.github/workflows/dogfood.yml b/.github/workflows/dogfood.yml
index ce2cb5ff0..7bb5d1396 100644
--- a/.github/workflows/dogfood.yml
+++ b/.github/workflows/dogfood.yml
@@ -27,4 +27,9 @@ jobs:
fetch-depth: 0
ref: ${{ github.head_ref }}
- name: Dogfood
- run: echo $GITHUB_BASE_REF; CGO_ENABLED=0 go run . git file://. --since_commit $GITHUB_BASE_REF
+ uses: ./
+ id: dogfood
+ with:
+ path: ./
+ base: ${{ github.event.repository.default_branch }}
+ head: HEAD
\ No newline at end of file
diff --git a/action.yml b/action.yml
new file mode 100644
index 000000000..33ca0c77b
--- /dev/null
+++ b/action.yml
@@ -0,0 +1,27 @@
+name: 'TruffleHog'
+description: 'Scan Github Actions with TruffleHog'
+author: Truffle Security Co. <[email protected]>
+
+inputs:
+ path:
+ description: Repository path
+ required: true
+ base:
+ description: Start scanning from here (usually main branch).
+ required: true
+ head:
+ description: Scan commits until here (usually dev branch).
+ required: false
+branding:
+ icon: "shield"
+ color: "green"
+runs:
+ using: "docker"
+ image: "Dockerfile"
+ args:
+ - git
+ - file://${{ inputs.path }}
+ - --since-commit
+ - ${{ inputs.base }}
+ - --branch
+ - ${{ inputs.head }}
\ No newline at end of file
diff --git a/entrypoint.sh b/entrypoint.sh
new file mode 100644
index 000000000..91f455a4b
--- /dev/null
+++ b/entrypoint.sh
@@ -0,0 +1,4 @@
+#! /usr/bin/env bash
+
+args=("$@")
+/usr/bin/trufflehog ${args[@]}
\ No newline at end of file