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
7 changes: 1 addition & 6 deletions .github/workflows/prod-cicd.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
name: prod

on:
pull_request:
branches:
- main
push:
branches:
- main
workflow_dispatch:

Choose a reason for hiding this comment

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

P1 Badge workflow_dispatch에서 배포 경로가 실행되도록 복원

onworkflow_dispatch만 남기면 이 워크플로우의 이벤트 이름은 항상 workflow_dispatch가 되는데, 같은 파일의 docker-build/deploy 잡은 여전히 if: github.event_name == 'push'(44, 74행) 조건이라 수동 실행 시 항상 skip됩니다. 그 결과 이 커밋 이후 prod 파이프라인은 build만 돌고 이미지 푸시와 서버 배포가 전혀 수행되지 않아 운영 배포가 차단되므로, push 트리거를 유지하거나 조건식에 workflow_dispatch를 포함해야 합니다.

Useful? React with 👍 / 👎.

Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

수동 트리거 전환으로 배포 파이프라인이 사실상 멈춥니다.

Line 4에서 이벤트를 workflow_dispatch만 받도록 바꿨는데, Line 36/44/74가 여전히 github.event_name == 'push'라서 Upload JAR, docker-build, deploy가 전부 스킵됩니다. 또한 Line 97의 github.event.head_commit.message는 수동 실행에서 비어 있을 수 있습니다.

🔧 제안 수정안
 on:
   workflow_dispatch:

@@
       - name: Upload JAR
-        if: github.event_name == 'push'
+        if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
         uses: actions/upload-artifact@v4
@@
   docker-build:
     needs: build
-    if: github.event_name == 'push'
+    if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
     runs-on: ubuntu-latest
@@
   deploy:
     needs: docker-build
-    if: github.event_name == 'push'
+    if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
     runs-on: ubuntu-latest
@@
       - name: Deploy to GCP Server
         uses: appleboy/ssh-action@v0.1.6
         env:
-          COMMIT_MSG: ${{ github.event.head_commit.message }}
+          COMMIT_MSG: ${{ github.event.head_commit.message || github.sha }}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/prod-cicd.yaml at line 4, The workflow was changed to
manual trigger but the job conditionals still check only for github.event_name
== 'push', causing "Upload JAR", "docker-build", and "deploy" to be skipped;
update those job/step if expressions (referencing the job names "Upload JAR",
"docker-build", "deploy") to allow workflow_dispatch as well (e.g.
github.event_name == 'push' || github.event_name == 'workflow_dispatch' or
contains(fromJson('["push","workflow_dispatch"]'), github.event_name)), and make
the usage of github.event.head_commit.message null-safe by guarding it (e.g. use
github.event.head_commit && github.event.head_commit.message or provide a
default empty string) wherever github.event.head_commit.message is referenced.


env:
IMAGE_NAME: asia-northeast3-docker.pkg.dev/souzip-488211/souzip-prod-repo/souzip-api:latest
Expand Down
Loading