Skip to content

Commit eb14478

Browse files
committed
workflow to clear config.ts
1 parent b1dfc25 commit eb14478

2 files changed

Lines changed: 52 additions & 0 deletions

File tree

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Sanitize Configuration
2+
3+
on:
4+
push:
5+
branches:
6+
- workflow-test
7+
paths-ignore:
8+
- "src/config.ts" # Prevent recursive triggers
9+
10+
jobs:
11+
sanitize-config:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout Repository
16+
uses: actions/checkout@v4
17+
18+
- name: Sanitize Configuration
19+
run: |
20+
# Paths
21+
SANITIZED_CONFIG_FILE="sanitized-config.txt"
22+
CONFIG_FILE="src/config.ts"
23+
24+
# Ensure sanitized config file exists
25+
if [ ! -f "$SANITIZED_CONFIG_FILE" ]; then
26+
echo "Sanitized config template not found"
27+
exit 1
28+
fi
29+
30+
# Read sanitized content
31+
SANITIZED_CONTENT=$(cat "$SANITIZED_CONFIG_FILE")
32+
33+
# Overwrite config file with sanitized content
34+
echo "$SANITIZED_CONTENT" > "$CONFIG_FILE"
35+
36+
# Configure git
37+
git config user.name "GitHub Actions Bot"
38+
git config user.email "<>"
39+
40+
# Stage and force push the sanitized config
41+
git add "$CONFIG_FILE"
42+
git commit -m "Sanitize configuration [skip ci]"
43+
git push origin HEAD:${GITHUB_REF} -f

sanitized-config.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// export const {PORT, CLIENT_ID, CLIENT_SECRET, GOOGLE_REDIRECT_URI: REDIRECT_URI, MONGODB_URI, TOKEN_SECRET} = process.env;
2+
3+
4+
export const PORT = 0
5+
export const CLIENT_ID = ""
6+
export const CLIENT_SECRET = ""
7+
export const GITHUB_CALLBACK_URL = ``
8+
export const MONGODB_URI = ""
9+
export const TOKEN_SECRET = ""

0 commit comments

Comments
 (0)