-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MP-907] Detect Secrets Action共有 (#1)
* add action * add lint * Update README.md * Update README.md
- Loading branch information
Han Sen
authored
Jan 10, 2024
1 parent
e481535
commit 5e6088f
Showing
3 changed files
with
73 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
name: Workflows Linter | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
workflows-linter: | ||
uses: sensyn-robotics/github-actions/.github/workflows/actionlint.yaml@main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,37 @@ | ||
# github-action-detect-secrets | ||
# 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 | ||
|
||
<!-- start usage --> | ||
```yaml | ||
- uses: sensyn-robotics/github-action-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" | ||
``` | ||
<!-- end usage --> | ||
**Basic:** | ||
```yaml | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Run DetectSecrets | ||
uses: sensyn-robotics/github-action-detect-secrets@v1 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 }} |