Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure ALL pushed commits are scanned and the default config is usable #22

Merged
merged 3 commits into from
Jan 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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