Skip to content

Commit 3db9cf1

Browse files
authored
Merge pull request #8 from masa0902dev/feat/actions-with-jwt
actions OIDC debug, eslintrcのparsing error解消
2 parents 49ea9d8 + 3b4c801 commit 3db9cf1

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

.github/workflows/saveToFirestore.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,22 @@ jobs:
2929
- name: Generate OIDC Token
3030
id: get-jwt
3131
run: |
32+
echo "Requesting OIDC Token..."
3233
TOKEN=$(curl -s -H "Authorization: Bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \
3334
-H "Accept: application/json" \
3435
https://vstoken.actions.githubusercontent.com/v1/token?audience=https://firestore-fzxwlwc6iq-an.a.run.app/forecast)
35-
echo "JWT_TOKEN=$(echo $TOKEN | jq -r '.value')" >> $GITHUB_ENV
36-
env:
37-
ACTIONS_ID_TOKEN_REQUEST_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
37+
# トークンの取得結果を表示
38+
echo "Raw Token Response: $TOKEN"
39+
40+
# トークンを抽出
41+
JWT_TOKEN=$(echo $TOKEN | jq -r '.value')
42+
43+
# JWT_TOKENの内容を表示
44+
echo "Extracted JWT Token: $JWT_TOKEN"
45+
46+
# 環境変数に設定
47+
echo "JWT_TOKEN=$JWT_TOKEN" >> $GITHUB_ENV
3848
3949
# TypeScript ファイルを実行して外部APIを叩き、Firestore APIに送信
4050
- name: Run TypeScript File

functions/.eslintrc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ module.exports = {
1414
],
1515
parser: "@typescript-eslint/parser",
1616
parserOptions: {
17-
// これによってfunctions内のエラーは治った
18-
project: ["./tsconfig.json"],
17+
// これによってfunctions内のエラーは治った(プロジェクトルートを使う"tsconfig.json"のようにするとlint実行時にエラー)
18+
project: ["./tsconfig.json", "./functions/tsconfig.json"],
1919
sourceType: "module",
2020
},
2121
ignorePatterns: ["/lib/**/*", "/generated/**/*"],

0 commit comments

Comments
 (0)