Skip to content
Open
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
07c6b75
feat: create GitHub Action
scottschreckengaust Jun 30, 2025
a83b486
Update action.yml
scottschreckengaust Jun 30, 2025
765d267
Update action.yml
scottschreckengaust Jun 30, 2025
a14a8cf
Update action.yml
scottschreckengaust Jun 30, 2025
80138d6
Update action.yml
scottschreckengaust Jun 30, 2025
0a13ea9
Update action.yml
scottschreckengaust Jun 30, 2025
be9701f
Update action.yml
scottschreckengaust Jun 30, 2025
1c32a3b
Update action.yml
scottschreckengaust Jun 30, 2025
14a19cd
Update action.yml
scottschreckengaust Jun 30, 2025
d939a47
Update action.yml
scottschreckengaust Jun 30, 2025
bb7774f
Update action.yml
scottschreckengaust Jun 30, 2025
5882c01
Update action.yml
scottschreckengaust Jun 30, 2025
6a8d9b1
Update action.yml
scottschreckengaust Jun 30, 2025
a402730
Update action.yml
scottschreckengaust Jun 30, 2025
9832b94
Update action.yml
scottschreckengaust Jun 30, 2025
a1bcd4c
Update action.yml
scottschreckengaust Jun 30, 2025
c99da7f
Update action.yml
scottschreckengaust Jun 30, 2025
b3877e1
Update action.yml
scottschreckengaust Jun 30, 2025
0c2dde7
Update action.yml
scottschreckengaust Jun 30, 2025
e062b28
Update action.yml
scottschreckengaust Jun 30, 2025
6111444
Update action.yml
scottschreckengaust Jun 30, 2025
05d73eb
Update action.yml
scottschreckengaust Jun 30, 2025
f8fc42c
Update action.yml
scottschreckengaust Jun 30, 2025
6fab6e8
Update action.yml
scottschreckengaust Jun 30, 2025
9fc8bca
Update action.yml
scottschreckengaust Jun 30, 2025
cbc2a64
Update action.yml
scottschreckengaust Jun 30, 2025
a8e0076
Update action.yml
scottschreckengaust Jul 1, 2025
07fe33f
Update action.yml
scottschreckengaust Jul 1, 2025
f3a81e3
Update action.yml
scottschreckengaust Jul 1, 2025
d72f19c
Merge branch 'awslabs:master' into feature/git-secrets-github-action
scottschreckengaust Dec 2, 2025
24749fa
Add fetch-depth input to action.yml
scottschreckengaust Dec 3, 2025
315c844
List contents of git-secrets-repository
scottschreckengaust Dec 3, 2025
3c11ee4
Update action.yml
scottschreckengaust Dec 3, 2025
c940907
Update action.yml
scottschreckengaust Dec 3, 2025
3dc1140
Done
scottschreckengaust Dec 4, 2025
6ffe091
Update action.yml
scottschreckengaust Dec 4, 2025
b8e2fc1
constants
scottschreckengaust Dec 4, 2025
1ef9b19
env
scottschreckengaust Dec 4, 2025
14a9e73
pwd
scottschreckengaust Dec 4, 2025
1f3c06f
consolidated
scottschreckengaust Dec 4, 2025
eaf29fd
path ref
scottschreckengaust Dec 4, 2025
7ad8ca5
GITHUB_WORKSPACE
scottschreckengaust Dec 4, 2025
c285b10
default branch
scottschreckengaust Dec 4, 2025
611c531
cleanup
scottschreckengaust Dec 4, 2025
c8367e3
list .gitallowed
scottschreckengaust Dec 4, 2025
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
94 changes: 94 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
---
# Scan with git-secrets
#
# EXAMPLE USAGE
#
# - uses: awslabs/git-secrets
# with:
# checkout: true
# fetch-depth: 0
# ref: ''
# scan-type: '--scan'
branding:
color: 'orange'
icon: 'activity'
description: Scan the repository history with git-secrets with register-aws
inputs:
checkout:
default: true
description: 'If "true" will checkout, otherwise the GITHUB_WORKSPACE already checked out'
required: false
type: boolean
fetch-depth:
default: '0'
description: 'The fetch-depth if `checkout` is "true", ignored otherwise'
required: false
type: string
ref:
default: ''
description: 'A version, ref, or hash of awslabs/git-secrets to use with the default branch as the default'
required: false
type: string
scan-type:
default: '--scan'
description: 'The type of scan'
required: false
type: choice
options:
- '--scan'
- '--scan-history'
name: scan
runs:
steps:
- name: Setup environmental variables
run: |
# Setup environmental variables
echo "GIT_SECRETS_REPOSITORY_PATH=$GITHUB_WORKSPACE/git-secrets-repository" >> "$GITHUB_ENV"
shell: bash
- name: Checkout awslabs/git-secrets
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
repository: 'awslabs/git-secrets'
ref: ${{ inputs.ref }}
path: ${{ env.GIT_SECRETS_REPOSITORY_PATH }}
- env:
PREFIX : ${{ runner.temp }}/git-secrets-prefix
MANPREFIX: ${{ runner.temp }}/git-secrets-manprefix
name: Make git-secrets
run: |
# Make git-secrets
cd $GIT_SECRETS_REPOSITORY_PATH
make install;
# Add to the PATH
echo "$PREFIX/bin/" >> "$GITHUB_PATH"
# No longer need the source
cd $GITHUB_WORKSPACE
rm -r -f $GIT_SECRETS_REPOSITORY_PATH
shell: bash
- if: inputs.checkout
name: Checkout the repository to scan history
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
fetch-depth: ${{ inputs.fetch-depth }} # to scan history
- name: Install git-secrets
run: |
echo "::group::Install git-secrets"
git-secrets --install
echo "::endgroup::"
echo "::group::Register AWS"
git-secrets --register-aws
echo "::endgroup::"
echo "::group::List git-secrets"
git-secrets --list
echo "::endgroup::"
echo "::group::Allowed git-secrets"
cat .gitallowed || echo ""
echo "::endgroup::"
shell: bash
- name: Scan with git-secrets
run: |
# Scan with git-secrets
echo "Scan with git-secrets"
git-secrets ${{ inputs.scan-type }}
shell: bash
using: "composite"