Skip to content

Commit

Permalink
Merge pull request #2 from edplato/test-priv-pr
Browse files Browse the repository at this point in the history
Revise arguments for scanArguments use
  • Loading branch information
edplato authored Jan 9, 2020
2 parents 38ff594 + fb81532 commit 3f7ce3f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,24 +48,26 @@ steps:
- uses: actions/checkout@master
- name: trufflehog-actions-scan
uses: edplato/trufflehog-actions-scan@master
with:
args: "--regex --entropy=False --max_depth=5" # Add custom options here*
with:
scanArguments: "--regex --entropy=False --max_depth=5" # Add custom options here*

```

*if custom options argument string is used, it will overwrite default settings

### Private GitHub Repository

Pass a GitHub access token to action to clone from a private GitHub repository. You can't use the default `GITHUB_TOKEN` as it doesn't have the permission to clone the repository. You have to create an access token manually.
Pass a GitHub access token to action to clone from a private GitHub repository.
You can't use the default `GITHUB_TOKEN` as it doesn't have the permission to clone the repository.

```yaml
steps:
- uses: actions/checkout@master
- name: trufflehog-actions-scan
uses: edplato/trufflehog-actions-scan@master
with:
githubToken: ${{ secrets.GITHUB_CLONE_TOKEN }}
githubToken: ${{ secrets.GITHUB_CLONE_TOKEN }} # You have to create an access token manually

```

----
Expand Down
5 changes: 4 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ runs:
image: 'Dockerfile'
inputs:
githubToken:
description: 'GitHub Token to access a privat repository'
description: 'GitHub Token to access a private repository.'
required: false
scanArguments:
description: 'Argument options for scan.'
required: false
branding:
icon: 'shield'
Expand Down
9 changes: 4 additions & 5 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ set -e # Abort script at first error

args="--regex --entropy=False --max_depth=50" # Default trufflehog options

if [ -n "$1" ]; then
args="$@" # Overwrite if new options string is provided
if [ -n "${INPUT_SCANARGUMENTS}" ]; then
args="${INPUT_SCANARGUMENTS}" # Overwrite if new options string is provided
fi


if [ -n "${INPUT_GITHUBTOKEN}" ]; then
githubRepo="https://$INPUT_GITHUBTOKEN@github.com/$GITHUB_REPOSITORY"
githubRepo="https://$INPUT_GITHUBTOKEN@github.com/$GITHUB_REPOSITORY" # Overwrite for private repository if token provided
else
githubRepo="https://github.com/$GITHUB_REPOSITORY"
githubRepo="https://github.com/$GITHUB_REPOSITORY" # Default target repository
fi

trufflehog $args $githubRepo

0 comments on commit 3f7ce3f

Please sign in to comment.