Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/Spring-develop-CD.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# CLUE CD Template
name: Spring Deplot to EC2

on:
Expand Down Expand Up @@ -35,7 +36,7 @@ jobs:
run: ./gradlew clean build

- name: 빌드된 파일 이름 변경하기
run: mv ./build/libs/*SNAPSHOT.jar ./CLUE-CD.jar
run: mv ./build/libs/*SNAPSHOT.jar ./cd.jar
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

와일드카드 mv가 여러 JAR에 매칭되면 실패하거나 잘못된 아티팩트를 선택할 수 있습니다

Spring Boot는 *-plain.jar도 생성합니다. 현재 패턴은 *-SNAPSHOT.jar 둘 다(일반/plain)를 매치할 수 있어 mv가 실패하거나 오작동합니다. 가장 최근의 non-plain JAR만 선택하도록 안전하게 변경하세요.

-        run: mv ./build/libs/*SNAPSHOT.jar ./cd.jar
+        run: |
+          set -euo pipefail
+          ARTIFACT="$(ls -t ./build/libs/*.jar | grep -vE '(-plain|sources|javadoc)\.jar$' | head -n1)"
+          echo "Using artifact: $ARTIFACT"
+          mv "$ARTIFACT" ./cd.jar
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
run: mv ./build/libs/*SNAPSHOT.jar ./cd.jar
run: |
set -euo pipefail
ARTIFACT="$(ls -t ./build/libs/*.jar | grep -vE '(-plain|sources|javadoc)\.jar$' | head -n1)"
echo "Using artifact: $ARTIFACT"
mv "$ARTIFACT" ./cd.jar
🤖 Prompt for AI Agents
.github/workflows/Spring-develop-CD.yml around line 39: the mv uses a wildcard
that can match multiple jars (including *-plain.jar) causing failures or wrong
artifact selection; change the step to pick the most recent non-plain SNAPSHOT
JAR by listing build/libs sorted by modification time, filtering out files
matching "-plain.jar", selecting the first result, and moving that single file
to ./cd.jar so mv operates on exactly one artifact.


- name: SCP로 EC2에 빌드된 파일 전송하기
uses: appleboy/scp-action@v0.1.7
Expand Down
Loading