Skip to content

Commit

Permalink
Merge pull request gitleaks#22 from niall-byrne/master
Browse files Browse the repository at this point in the history
Ensure ALL pushed commits are scanned and the default config is usable
  • Loading branch information
zricethezav authored Jan 22, 2021
2 parents 09e85d4 + 6265ca0 commit 6e41781
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/gitleaks.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
name: gitleaks

on: [push,pull_request]
on: [push, pull_request, workflow_dispatch]

jobs:
gitleaks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: gitleaks-action
uses: zricethezav/gitleaks-action@master
- uses: actions/checkout@v1
- name: gitleaks-action with defaults
uses: zricethezav/gitleaks-action@master
- name: gitleaks-action with config
uses: zricethezav/gitleaks-action@master
with:
config-path: .gitleaks.yml
6 changes: 2 additions & 4 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ CONFIG=""
# check if a custom config have been provided
if [ -f "$GITHUB_WORKSPACE/$INPUT_CONFIG_PATH" ]; then
CONFIG=" --config-path=$GITHUB_WORKSPACE/$INPUT_CONFIG_PATH"
else
CONFIG=" --config-path=$GITHUB_WORKSPACE/.gitleaks.toml"
fi

echo running gitleaks "$(gitleaks --version) with the following command👇"
Expand All @@ -16,8 +14,8 @@ DONATE_MSG="👋 maintaining gitleaks takes a lot of work so consider sponsoring

if [ "$GITHUB_EVENT_NAME" = "push" ]
then
echo gitleaks --path=$GITHUB_WORKSPACE --verbose --redact --commit=$GITHUB_SHA $CONFIG
CAPTURE_OUTPUT=$(gitleaks --path=$GITHUB_WORKSPACE --verbose --redact --commit=$GITHUB_SHA $CONFIG)
echo gitleaks --path=$GITHUB_WORKSPACE --verbose --redact $CONFIG
CAPTURE_OUTPUT=$(gitleaks --path=$GITHUB_WORKSPACE --verbose --redact $CONFIG)
elif [ "$GITHUB_EVENT_NAME" = "pull_request" ]
then
git --git-dir="$GITHUB_WORKSPACE/.git" log --left-right --cherry-pick --pretty=format:"%H" remotes/origin/$GITHUB_BASE_REF... > commit_list.txt
Expand Down

0 comments on commit 6e41781

Please sign in to comment.