Skip to content

Commit f0ef2f8

Browse files
committed
fix: 소나 분석에서도 ssm에서 jwt 시크릿 키를 가져오도록 수정
1 parent a0c2031 commit f0ef2f8

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

.github/workflows/sonarcloud.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
pull_request:
88
branches:
99
- main
10+
env:
11+
AWS_REGION: ap-northeast-2
12+
1013
jobs:
1114
test:
1215
runs-on: ubuntu-latest
@@ -21,6 +24,24 @@ jobs:
2124
java-version: 21
2225
distribution: 'temurin'
2326

27+
- name: Configure AWS credentials
28+
uses: aws-actions/configure-aws-credentials@v4
29+
with:
30+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
31+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
32+
aws-region: ${{ env.AWS_REGION }}
33+
34+
- name: Get TEST_JWT_SECRET_KEY from SSM
35+
id: get-test-secret
36+
run: |
37+
SECRET_VALUE=$(aws ssm get-parameter \
38+
--name "/common/TEST_JWT_SECRET_KEY" \
39+
--with-decryption \
40+
--region "${{ env.AWS_REGION }}" \
41+
--query "Parameter.Value" \
42+
--output text)
43+
echo "TEST_JWT_SECRET_KEY=$SECRET_VALUE" >> $GITHUB_ENV
44+
2445
- name: Grant execute permission for gradlew
2546
run: chmod +x ./gradlew
2647

@@ -35,4 +56,5 @@ jobs:
3556
env:
3657
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3758
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
38-
run: ./gradlew test jacocoTestReport sonar --info
59+
TEST_JWT_SECRET_KEY: ${{ env.TEST_JWT_SECRET_KEY }}
60+
run: ./gradlew test jacocoTestReport sonar --info

0 commit comments

Comments
 (0)