Skip to content

Commit c5bacf9

Browse files
committed
ci: add git-secrets workflow
1 parent 8c43daf commit c5bacf9

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Git Secrets Check
2+
on: workflow_call
3+
4+
jobs:
5+
git_secrets_check:
6+
name: Scan for secrets
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout repository
10+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
11+
with:
12+
path: amplify-js
13+
14+
- name: Install git-secrets
15+
run: |
16+
git clone https://github.com/awslabs/git-secrets.git
17+
cd git-secrets
18+
sudo make install
19+
20+
- name: Register AWS patterns and scan
21+
working-directory: ./amplify-js
22+
run: |
23+
git secrets --register-aws
24+
# Scan only the files in the current checkout (PR merge commit)
25+
git secrets --scan

.github/workflows/pr.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ jobs:
4343
dependency-review:
4444
needs: prebuild
4545
uses: ./.github/workflows/callable-dependency-review.yml
46+
git-secrets-check:
47+
uses: ./.github/workflows/callable-git-secrets-check.yml
4648
all-unit-tests-pass:
4749
name: Unit and Bundle tests have passed
4850
needs:
@@ -52,6 +54,7 @@ jobs:
5254
- github-actions-test
5355
- tsc-compliance-test
5456
- dependency-review
57+
- git-secrets-check
5558
runs-on: ubuntu-latest
5659
if: success() # only run when all checks have passed
5760
# store success output flag for ci job

0 commit comments

Comments
 (0)