Skip to content

Commit

Permalink
feat: 권한 설정 + 파일이 실제하는지 자바 코드에서 확인
Browse files Browse the repository at this point in the history
  • Loading branch information
Doncham committed Sep 12, 2024
1 parent a4add55 commit fc5d839
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/workflows/githubAction.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ jobs:
name: "firebase_service_key.json"
json: ${{ secrets.APPLICATION_FIREBASE_KEY }}

- name: Set permissions for firebase_service_key.json
run: chmod 644 ./firebase_service_key.json

- name: JSON file location
run: |
pwd # 현재 경로 출력
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import okhttp3.*;

import org.springframework.stereotype.Service;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.List;
Expand Down Expand Up @@ -50,8 +52,14 @@ public String makeMessage(String targetToken, String title, String body) throws
return objectMapper.writeValueAsString(fcmMessage);
}
private String getAccessToken() throws IOException {
File file = new File("/home/runner/work/Code-Bridge/Code-Bridge/firebase_service_key.json");
if(file.exists()) {
System.out.println("File exists");
} else {
System.out.println("File not found");
}
// GitHub Actions에서 생성된 firebase_service_key.json 파일의 경로
String firebaseConfigPath = "/home/runner/work/Code-Bridge/Code-Bridge/firebase_service_key.json";
String firebaseConfigPath = "firebase_service_key.json";

// 파일을 읽어 GoogleCredentials 생성
GoogleCredentials googleCredentials = GoogleCredentials
Expand Down

0 comments on commit fc5d839

Please sign in to comment.