From 29ee36f78487030b415af5ad4b1ffcca9bb40cd9 Mon Sep 17 00:00:00 2001 From: Andrey Danin Date: Wed, 6 Dec 2023 19:41:14 +0300 Subject: [PATCH] Initial commit --- Dockerfile | 6 ++++++ README.md | 18 ++++++++++++++++++ action.yml | 8 ++++++++ entrypoint.sh | 10 ++++++++++ 4 files changed, 42 insertions(+) create mode 100644 Dockerfile create mode 100644 README.md create mode 100644 action.yml create mode 100755 entrypoint.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9eb0d8f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM zricethezav/gitleaks:v8.18.1 + +COPY entrypoint.sh /entrypoint.sh + +ENTRYPOINT ["/entrypoint.sh"] + diff --git a/README.md b/README.md new file mode 100644 index 0000000..132d4a6 --- /dev/null +++ b/README.md @@ -0,0 +1,18 @@ +# Gitleaks docker action + +This action checks source code for security issues in pull request. + +**IMPORTANT:** this action works with pull requests only. + +## Inputs + +No inputs + +## Outputs + +No outputs + +## Example usage + +uses: actions/gitleaks-docker-action@v1 + diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..2696b0e --- /dev/null +++ b/action.yml @@ -0,0 +1,8 @@ +name: 'Gitleaks docker' +description: 'Test code for secrets using Gitleaks' +inputs: +outputs: +runs: + using: 'docker' + image: 'Dockerfile' + args: [] diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..b32741e --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,10 @@ +#!/bin/sh -l +# +# Copyright: +# Copyright (c) 2023. AVROID, Ltd. All Rights Reserved. +# + +echo "Processing event '$GITHUB_EVENT_NAME'" + +gitleaks detect --verbose --redact --log-opts "--first-parent --no-merges origin/$GITHUB_BASE_REF..$GITHUB_SHA" +