Skip to content

Commit 8bbd178

Browse files
committed
Remove hardcoded Firebase credentials from the repo
The hardcoded Firebase credentials were removed for security concerns. They are now loaded from GitHub secrets during workflows in both 'docker.yml' and 'test.yml'. This provides the same functionality without exposing sensitive data on the repository. Additionally, the file has been added to .gitignore to prevent accidental commit in the future.
1 parent 2fe2b31 commit 8bbd178

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

.github/workflows/docker.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ jobs:
3939
- run: echo "$APPLICATION_SECRET_PROPERTIES" > src/test/resources/application-secret.properties
4040
env:
4141
APPLICATION_SECRET_PROPERTIES: ${{ secrets.APPLICATION_SECRET_PROPERTIES }}
42+
- name: Get FIREBASE_JSON from secrets
43+
run: |
44+
echo $FIREBASE_JSON > src/main/resources/banyuwangi-dashboard-firebase-adminsdk.json
45+
env:
46+
FIREBASE_JSON: ${{ secrets.FIREBASE_JSON }}
4247
- name: Test and assemble with Gradle
4348
run: ./gradlew assemble
4449
env:

.github/workflows/test.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ jobs:
3535
- run: echo "$APPLICATION_SECRET_PROPERTIES" > src/test/resources/application-secret.properties
3636
env:
3737
APPLICATION_SECRET_PROPERTIES: ${{ secrets.APPLICATION_SECRET_PROPERTIES }}
38+
- name: Get FIREBASE_JSON from secrets
39+
run: |
40+
echo $FIREBASE_JSON > src/main/resources/banyuwangi-dashboard-firebase-adminsdk.json
41+
env:
42+
FIREBASE_JSON: ${{ secrets.FIREBASE_JSON }}
3843
- name: Install docker
3944
run: |
4045
command docker -v || curl -fsSL get.docker.com | sudo bash

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,5 @@ out/
4242
*.mv.db
4343
*.trace.db
4444
*.lock.db
45+
46+
src/main/resources/banyuwangi-dashboard-firebase-adminsdk.json

src/main/resources/banyuwangi-dashboard-firebase-adminsdk.json

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)