Merge pull request #24 from Leets-Official/feat/#23/layout-setting #41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: | |
| - 'dev' | |
| pull_request: | |
| branches: | |
| - 'dev' | |
| permissions: | |
| contents: read | |
| issues: write | |
| pull-requests: write | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| verify: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: TypeScript type check | |
| id: typecheck | |
| run: pnpm typecheck | |
| - name: ESLint check | |
| id: lint | |
| run: pnpm lint | |
| - name: Prettier check | |
| id: prettier | |
| run: pnpm format:check | |
| - name: Build check | |
| id: build | |
| run: pnpm build | |
| - name: Write CI summary | |
| if: ${{ always() }} | |
| run: | | |
| { | |
| echo "## 🚦 CI 검증 결과" | |
| echo "" | |
| echo "| 항목 | 결과 |" | |
| echo "| --- | --- |" | |
| echo "| 🧠 TypeScript 타입 체크 | ${{ steps.typecheck.outcome }} |" | |
| echo "| 🧹 ESLint 검사 | ${{ steps.lint.outcome }} |" | |
| echo "| 🎨 Prettier 검사 | ${{ steps.prettier.outcome }} |" | |
| echo "| 🏗️ Build 검증 | ${{ steps.build.outcome }} |" | |
| } >> "$GITHUB_STEP_SUMMARY" | |
| - name: Comment CI result on pull request | |
| if: ${{ always() && github.event_name == 'pull_request' }} | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const marker = '<!-- ci-result-comment -->' | |
| const body = [ | |
| marker, | |
| '## 🚦 CI 검증 결과', | |
| '', | |
| '| 항목 | 결과 |', | |
| '| --- | --- |', | |
| `| 🧠 TypeScript 타입 체크 | ${'${{ steps.typecheck.outcome }}'} |`, | |
| `| 🧹 ESLint 검사 | ${'${{ steps.lint.outcome }}'} |`, | |
| `| 🎨 Prettier 검사 | ${'${{ steps.prettier.outcome }}'} |`, | |
| `| 🏗️ Build 검증 | ${'${{ steps.build.outcome }}'} |`, | |
| ].join('\n') | |
| const { owner, repo } = context.repo | |
| const issue_number = context.issue.number | |
| const comments = await github.paginate(github.rest.issues.listComments, { | |
| owner, | |
| repo, | |
| issue_number, | |
| per_page: 100, | |
| }) | |
| const existing = comments.find((comment) => { | |
| return comment.user?.type === 'Bot' && comment.body?.includes(marker) | |
| }) | |
| if (existing) { | |
| await github.rest.issues.updateComment({ | |
| owner, | |
| repo, | |
| comment_id: existing.id, | |
| body, | |
| }) | |
| return | |
| } | |
| await github.rest.issues.createComment({ | |
| owner, | |
| repo, | |
| issue_number, | |
| body, | |
| }) |