Skip to content

Commit 286b201

Browse files
committed
add logic for gitignore step
1 parent 3451bd6 commit 286b201

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

.github/workflows/3-tbd.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
workflow_dispatch:
1010
# Add events that trigger this workflow.
1111
# TBD-step-3-event:
12+
push:
13+
paths:
14+
- .gitignore
1215

1316
# Reference: https://docs.github.com/en/actions/security-guides/automatic-token-authentication
1417
permissions:
@@ -54,6 +57,15 @@ jobs:
5457
fetch-depth: 0 # Let's get all the branches.
5558

5659
# TBD-step-3-additional-steps
60+
- name: Check if .gitignore contains .env
61+
run: |
62+
if grep -qw ".env" .gitignore; then
63+
echo ".env is in .gitignore"
64+
exit 0
65+
else
66+
echo ".env is not in .gitignore"
67+
exit 1
68+
fi
5769
5870
# In README.md, switch step 3 for step 4.
5971
- name: Update to step 4

0 commit comments

Comments
 (0)