We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 55647aa commit 67c1dcbCopy full SHA for 67c1dcb
1 file changed
.github/workflows/check-env.yml
@@ -0,0 +1,24 @@
1
+name: Check for .env in PR
2
+
3
+on:
4
+ pull_request:
5
+ branches: [ "main" ]
6
7
+jobs:
8
+ check-env:
9
+ name: Ensure .env file is not committed
10
+ runs-on: ubuntu-latest
11
12
+ steps:
13
+ - name: Checkout code
14
+ uses: actions/checkout@v4
15
16
+ - name: Check for .env file in PR
17
+ run: |
18
+ echo "Checking for .env files..."
19
+ if git diff --name-only origin/main...HEAD | grep -E '^(\.env|.*\/\.env)$'; then
20
+ echo "ERROR: .env file detected in pull request. Please remove it before merging."
21
+ exit 1
22
+ else
23
+ echo "No .env files found in PR."
24
+ fi
0 commit comments