Skip to content

Commit 33c37cd

Browse files
authored
Create infisical-secrets-check.yml (#28)
1 parent 57eb63a commit 33c37cd

File tree

1 file changed

+75
-0
lines changed

1 file changed

+75
-0
lines changed
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Infisical secrets check
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
11+
jobs:
12+
13+
secrets-scan:
14+
runs-on: ubuntu-latest
15+
steps:
16+
17+
- name: Checkout repo
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Set Infisical package source
23+
shell: bash
24+
run: curl -1sLf 'https://dl.cloudsmith.io/public/infisical/infisical-cli/setup.deb.sh' | sudo -E bash
25+
26+
- name: Install Infisical
27+
shell: bash
28+
run: |
29+
sudo apt-get update && sudo apt-get install -y infisical
30+
31+
- name: Run scan
32+
shell: bash
33+
run: infisical scan --redact -f csv -r secrets-result.csv 2>&1 | tee secrets-result.log
34+
35+
- name: Read secrets-result.log
36+
uses: guibranco/github-file-reader-action-v2@v2.1.535
37+
if: always()
38+
id: log
39+
with:
40+
path: secrets-result.log
41+
42+
- name: Read secrets-result.log
43+
uses: guibranco/github-file-reader-action-v2@v2.1.535
44+
if: failure()
45+
id: report
46+
with:
47+
path: secrets-result.csv
48+
49+
- name: Update PR with comment
50+
uses: mshick/add-pr-comment@v2
51+
if: always()
52+
with:
53+
refresh-message-position: true
54+
message-id: 'secrets-result'
55+
message: |
56+
**Infisical secrets check:** :white_check_mark: No secrets leaked!
57+
58+
**Scan results:**
59+
```
60+
${{ steps.log.outputs.contents }}
61+
```
62+
63+
message-failure: |
64+
**Infisical secrets check:** :rotating_light: Secrets leaked!.
65+
66+
**Scan results:**
67+
```
68+
${{ steps.log.outputs.contents }}
69+
```
70+
**Scan report:**
71+
```
72+
${{ steps.report.outputs.contents }}
73+
```
74+
message-cancelled: |
75+
**Infisical secrets check:** :o: Secrets check cancelled!.

0 commit comments

Comments
 (0)