From aff9a6d1cf0f348920e71d25836d47b017e4dc25 Mon Sep 17 00:00:00 2001 From: Han Sen Date: Wed, 10 Jan 2024 14:56:26 +0900 Subject: [PATCH 1/4] add action --- README.md | 37 ++++++++++++++++++++++++++++++++++++- action.yaml | 28 ++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 action.yaml diff --git a/README.md b/README.md index 9b8d6cd..f9d4a31 100644 --- a/README.md +++ b/README.md @@ -1 +1,36 @@ -# github-action-detect-secrets \ No newline at end of file +# github-action-detect-secrets + +## About +This is github action for running [detect-secrets](https://github.com/Yelp/detect-secrets) hook. + +it will run againts all files managed in git repository + + +## Prerequisites +create a baseline file for your repository +please refer: https://github.com/Yelp/detect-secrets?tab=readme-ov-file#adding-secrets-to-baseline + +## Usage + + +```yaml +- uses: sensyn-robotics/github-actions/.github/actions/detect-secrets@v1 + with: + # Baseline file for detect-secrets, relative to the mount-path + # Default; .secrets.baseline + baseline: '.secrets.baseline' + + # Version of detect-secrets + # When not specified, use latest + detect-secrets-version: "1.4.0" +``` + + +**Basic:** + +```yaml +steps: + - uses: actions/checkout@v3 + - name: Run DetectSecrets + uses: sensyn-robotics/github-actions/.github/actions/detect-secrets@v1 +``` diff --git a/action.yaml b/action.yaml new file mode 100644 index 0000000..d715412 --- /dev/null +++ b/action.yaml @@ -0,0 +1,28 @@ +name: 'detect-secrets-action' +description: 'Run detect-secrets on your codebase' +inputs: + baseline: + description: 'Baseline file path (relative to mount-path)' + required: true + default: '.secrets.baseline' + detect-secrets-version: + description: 'detect-secrets version' + +runs: + using: "composite" + steps: + - name: install detect-secrets + shell: bash + env: + VERSION: ${{ inputs.detect-secrets-version }} + run: | + if [ -z "$VERSION" ]; then + pip install detect-secrets + else + pip install detect-secrets==$VERSION + fi + - name: run detect-secrets + run: git ls-files -z | xargs -0 detect-secrets-hook --verbose --baseline $BASELINE + shell: bash + env: + BASELINE: ${{ inputs.baseline }} From b381d0f20536d1a374c4bd558a9206b2807d6899 Mon Sep 17 00:00:00 2001 From: Han Sen Date: Wed, 10 Jan 2024 14:59:24 +0900 Subject: [PATCH 2/4] add lint --- .github/workflows/actionlint.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .github/workflows/actionlint.yaml diff --git a/.github/workflows/actionlint.yaml b/.github/workflows/actionlint.yaml new file mode 100644 index 0000000..2ba3cad --- /dev/null +++ b/.github/workflows/actionlint.yaml @@ -0,0 +1,8 @@ +name: Workflows Linter + +on: + push: + +jobs: + workflows-linter: + uses: sensyn-robotics/github-actions/.github/workflows/actionlint.yaml@main From 0c9026600f7aa0e3c52f3d05f713999fb49da834 Mon Sep 17 00:00:00 2001 From: Han Sen Date: Wed, 10 Jan 2024 15:01:56 +0900 Subject: [PATCH 3/4] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index f9d4a31..9cfeccd 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ it will run againts all files managed in git repository ## Prerequisites create a baseline file for your repository + please refer: https://github.com/Yelp/detect-secrets?tab=readme-ov-file#adding-secrets-to-baseline ## Usage From 1ffd10aff85ba9737689c4460af293ac9e3082cc Mon Sep 17 00:00:00 2001 From: Han Sen Date: Wed, 10 Jan 2024 15:02:25 +0900 Subject: [PATCH 4/4] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9cfeccd..3f59130 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ please refer: https://github.com/Yelp/detect-secrets?tab=readme-ov-file#adding-s ```yaml -- uses: sensyn-robotics/github-actions/.github/actions/detect-secrets@v1 +- uses: sensyn-robotics/github-action-detect-secrets@v1 with: # Baseline file for detect-secrets, relative to the mount-path # Default; .secrets.baseline @@ -33,5 +33,5 @@ please refer: https://github.com/Yelp/detect-secrets?tab=readme-ov-file#adding-s steps: - uses: actions/checkout@v3 - name: Run DetectSecrets - uses: sensyn-robotics/github-actions/.github/actions/detect-secrets@v1 + uses: sensyn-robotics/github-action-detect-secrets@v1 ```