-
Notifications
You must be signed in to change notification settings - Fork 0
#49 chore: Github Actions CI/CD 파이프라인 구축 #50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
b8f84d9
87b6617
8c5b86b
ba049f8
f50c120
b295670
f736c0c
d576640
3174240
80894e1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| name-template: 'v$RESOLVED_VERSION' | ||
| tag-template: 'v$RESOLVED_VERSION' | ||
| version-template: $MAJOR.$MINOR.$PATCH | ||
|
|
||
| categories: | ||
| - title: '🚀 기능 추가' | ||
| labels: | ||
| - 'feat' | ||
| - title: '♻️ 리팩토링' | ||
| labels: | ||
| - 'refactor' | ||
| - title: '🐛 버그 수정' | ||
| labels: | ||
| - 'fix' | ||
| - title: '🧰 그 외' | ||
| labels: | ||
| - 'chore' | ||
| - 'ci/cd' | ||
| - 'docs' | ||
| - 'style' | ||
| - 'build' | ||
| - 'common' | ||
| - 'test' | ||
|
|
||
| version-resolver: | ||
| major: | ||
| labels: | ||
| - 'major' | ||
| minor: | ||
| labels: | ||
| - 'minor' | ||
| patch: | ||
| labels: | ||
| - 'patch' | ||
| default: minor | ||
|
|
||
| exclude-labels: | ||
| - 'Release' | ||
|
|
||
| change-template: '- $TITLE (#$NUMBER) - @$AUTHOR' | ||
| change-title-escapes: '\\<*_&' | ||
|
|
||
| template: | | ||
| ## ✨ 변경 사항 | ||
| $CHANGES | ||
|
|
||
| ## 📦 전체 변경 이력 | ||
| [$PREVIOUS_TAG ~ v$RESOLVED_VERSION](<https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION>) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| name: CI/CD Pipeline | ||
|
|
||
| on: | ||
| push: | ||
| branches: [develop, main] | ||
| pull_request: | ||
| branches: [develop, main] | ||
|
|
||
| # 동일한 브랜치에서 새로운 Push가 발생하면 이전 실행을 취소하여 자원 절약 | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| build-and-deploy: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
|
|
||
| - name: Install pnpm | ||
| uses: pnpm/action-setup@v4 | ||
| with: | ||
| version: 9 | ||
| run_install: false | ||
|
|
||
| - name: Get pnpm store directory | ||
| id: pnpm-cache | ||
| shell: bash | ||
| run: | | ||
| echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Setup pnpm cache | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | ||
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-pnpm-store- | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install | ||
|
|
||
| - name: Lint | ||
| run: pnpm lint | ||
|
|
||
| - name: Build | ||
| run: pnpm build | ||
| env: | ||
| VITE_KAKAO_REST_API_KEY: ${{ secrets.VITE_KAKAO_REST_API_KEY }} | ||
| VITE_KAKAO_REDIRECT_URI: ${{ secrets.VITE_KAKAO_REDIRECT_URI }} | ||
| VITE_API_BASE_URL: ${{ secrets.VITE_API_BASE_URL }} |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,36 @@ | ||||||
| name: Release Drafter | ||||||
|
|
||||||
| on: | ||||||
| push: | ||||||
| branches: | ||||||
| - release/* | ||||||
| - main | ||||||
| # PR 이벤트 추가로 자동화 범위 확대 | ||||||
| pull_request: | ||||||
| types: [opened, reopened, synchronize] | ||||||
|
|
||||||
| permissions: | ||||||
| contents: write | ||||||
| pull-requests: read | ||||||
|
|
||||||
| jobs: | ||||||
| update_release_draft: | ||||||
| runs-on: ubuntu-latest | ||||||
| steps: | ||||||
| # Checkout 단계 제거 (불필요한 작업 생략) | ||||||
| - name: Update Draft Release | ||||||
| if: startsWith(github.ref, 'refs/heads/release/') || github.event_name == 'pull_request' | ||||||
| uses: release-drafter/release-drafter@v6 | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # Check if the workflow file exists and verify lines 23 and 31
fd -g "release-drafter.yml" -x cat -n {} | head -40Repository: 2025-snowCode/snowCode-Client Length of output: 55 🌐 Web query:
💡 Result: The 🏁 Script executed: # Find the workflow file
fd -name "release-drafter.yml" -type fRepository: 2025-snowCode/snowCode-Client Length of output: 303 🏁 Script executed: # Also check the workflow directory structure
find . -path "./.git" -prune -o -type f -name "*.yml" -print | grep -i workflow | head -20Repository: 2025-snowCode/snowCode-Client Length of output: 301 🏁 Script executed: # Read the workflow file to check lines 23 and 31
cat -n ./.github/workflows/release-drafter.yml | sed -n '20,35p'Repository: 2025-snowCode/snowCode-Client Length of output: 790 써드파티 액션을 가변 태그
🔒 개선 방법 (현재 v6 커밋 SHA로 고정)- uses: release-drafter/release-drafter@v6
+ uses: release-drafter/release-drafter@6db134d15f3909ccc9eefd369f02bd1e9cffdf97 # v6.2.023번 줄과 31번 줄 모두 동일하게 수정해주세요. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| with: | ||||||
| config-name: template/release-drafter.yml | ||||||
| env: | ||||||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||||
|
|
||||||
| - name: Publish Release | ||||||
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' | ||||||
| uses: release-drafter/release-drafter@v6 | ||||||
| with: | ||||||
| config-name: template/release-drafter.yml | ||||||
| publish: true | ||||||
| env: | ||||||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pull_request트리거에 브랜치 필터 없음 + 포크 PR 권한 문제두 가지 연관된 문제가 있습니다:
브랜치 필터 미지정:
pull_request이벤트에branches필터가 없어, 기능 브랜치(예:feature/* → feature/*) 대상 PR 포함 모든 PR에서 워크플로우가 실행됩니다. 불필요한 실행을 줄이려면 대상 브랜치를 명시하는 것이 좋습니다.포크 PR 권한 부족:
pull_request이벤트는 포크에서 생성된 PR에 대해GITHUB_TOKEN이 읽기 전용으로 제한됩니다. "Update Draft Release" 스텝은contents: write권한이 필요하므로, 외부 기여자의 포크 PR에서 실패할 수 있습니다.pull_request_target이벤트를 사용하면 포크 PR에서도 쓰기 권한이 유지됩니다. 단, 이 이벤트는 PR 브랜치가 아닌 베이스 브랜치에서 실행됩니다.✨ 개선 제안
on: push: branches: - release/* - main - # PR 이벤트 추가로 자동화 범위 확대 - pull_request: - types: [opened, reopened, synchronize] + # pull_request_target: 포크 PR에서도 write 권한 유지 + pull_request_target: + types: [opened, reopened, synchronize] + branches: + - develop + - main + - release/*🤖 Prompt for AI Agents