-
Notifications
You must be signed in to change notification settings - Fork 4
Feat/setting/eslint setting/DEVING-31 #5
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
ffe8e38
6242610
d5b6cff
b8ab784
f80da4b
40ab350
ade5f7d
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,90 @@ | ||
| name: PR Check | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize, reopened] | ||
|
|
||
| jobs: | ||
| check: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v3 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v3 | ||
| with: | ||
| node-version: '18' | ||
| cache: 'npm' | ||
|
|
||
| - name: Install dependencies | ||
| id: install | ||
| run: npm ci | ||
|
|
||
| - name: Lint check | ||
| id: lint | ||
| continue-on-error: true | ||
| run: npm run lint:fix | ||
|
|
||
| - name: Format check | ||
| id: format | ||
| continue-on-error: true | ||
| run: npm run format | ||
|
|
||
| - name: Type check | ||
| id: typecheck | ||
| continue-on-error: true | ||
| run: npx tsc --noEmit | ||
|
|
||
| - name: Run tests | ||
| id: test | ||
| continue-on-error: true | ||
| run: npm run test | ||
|
|
||
| - name: Upload coverage reports to Codecov | ||
| uses: codecov/codecov-action@v3 | ||
| with: | ||
| token: ${{ secrets.CODECOV_TOKEN }} | ||
|
|
||
| - name: Build check | ||
| id: build | ||
| continue-on-error: true | ||
| run: npm run build | ||
|
|
||
| - name: Report Status | ||
| if: always() | ||
| uses: actions/github-script@v6 | ||
| with: | ||
| script: | | ||
| const steps = { | ||
| lint: '${{ steps.lint.outcome }}', | ||
| format: '${{ steps.format.outcome }}', | ||
| typecheck: '${{ steps.typecheck.outcome }}', | ||
| test: '${{ steps.test.outcome }}', | ||
| build: '${{ steps.build.outcome }}' | ||
| }; | ||
|
|
||
| const emoji = (status) => status === 'success' ? 'โ ' : 'โ'; | ||
|
|
||
| const body = `## CI Status Report\n\n` + | ||
| `### ๊ฒ์ฌ ๊ฒฐ๊ณผ\n` + | ||
| `- Lint: ${emoji(steps.lint)} ${steps.lint}\n` + | ||
| `- Format: ${emoji(steps.format)} ${steps.format}\n` + | ||
| `- Type Check: ${emoji(steps.typecheck)} ${steps.typecheck}\n` + | ||
| `- Tests: ${emoji(steps.test)} ${steps.test}\n` + | ||
| `- Build: ${emoji(steps.build)} ${steps.build}\n\n` + | ||
| `${Object.values(steps).every(s => s === 'success') ? 'โ ๋ชจ๋ ๊ฒ์ฌ๊ฐ ํต๊ณผ๋์์ต๋๋ค.' : 'โ ์ผ๋ถ ๊ฒ์ฌ๊ฐ ์คํจํ์ต๋๋ค.'}`; | ||
|
|
||
| await github.rest.issues.createComment({ | ||
| ...context.repo, | ||
| issue_number: context.issue.number, | ||
| body: body | ||
| }); | ||
|
|
||
| if (Object.values(steps).some(s => s === 'failure')) { | ||
| core.setFailed('Some checks failed'); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| name: PR Labeler | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, edited] | ||
|
|
||
| jobs: | ||
| label: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
|
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. ๐ ๏ธ Refactor suggestion Update GitHub Actions to latest versions. Similar to pr-check.yml, update to the latest versions:
Also applies to: 13-13 ๐งฐ Tools๐ช actionlint (1.7.4)10-10: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue (action) |
||
|
|
||
| - name: Label PR based on commit messages | ||
| uses: actions/github-script@v6 | ||
| with: | ||
| script: | | ||
| try { | ||
| const { data: commits } = await github.rest.pulls.listCommits({ | ||
| ...context.repo, | ||
| pull_number: context.issue.number | ||
| }); | ||
|
|
||
| const labels = new Set(); | ||
| commits.forEach(commit => { | ||
| const msg = commit.commit.message; | ||
| // Using regex to match your commit convention: type(issue) message | ||
| const typeMatch = msg.match(/^(feat|fix|style|refactor|test|docs|chore|setting)\(/i); | ||
|
|
||
| if (typeMatch) { | ||
| const type = typeMatch[1].toLowerCase(); | ||
| switch (type) { | ||
| case 'feat': | ||
| labels.add('โจ feat'); | ||
| break; | ||
| case 'fix': | ||
| labels.add('๐ fix'); | ||
| break; | ||
| case 'style': | ||
| labels.add('๐ style'); | ||
| break; | ||
| case 'refactor': | ||
| labels.add('โป๏ธ refactor'); | ||
| break; | ||
| case 'test': | ||
| labels.add('โ test'); | ||
| break; | ||
| case 'docs': | ||
| labels.add('๐ docs'); | ||
| break; | ||
| case 'chore': | ||
| labels.add('๐ง chore'); | ||
| break; | ||
| case 'setting': | ||
| labels.add('โ๏ธ setting'); | ||
| break; | ||
| } | ||
| } | ||
| }); | ||
|
|
||
| if (labels.size > 0) { | ||
| await github.rest.issues.addLabels({ | ||
| ...context.repo, | ||
| issue_number: context.issue.number, | ||
| labels: Array.from(labels) | ||
| }); | ||
| } | ||
| } catch (error) { | ||
| core.setFailed(`Action failed with error: ${error}`); | ||
| } | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| // jest.config.ts | ||
|
|
||
| import type { Config } from 'jest'; | ||
| import nextJest from 'next/jest.js'; | ||
|
|
||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1 @@ | ||
| module.exports = { | ||
| plugins: { | ||
| tailwindcss: {}, | ||
| autoprefixer: {}, | ||
| }, | ||
| }; | ||
| module.exports = { plugins: { tailwindcss: {}, autoprefixer: {} } }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| import type { Metadata } from 'next'; | ||
|
|
||
| import './globals.css'; | ||
|
|
||
| export const metadata: Metadata = { | ||
|
|
||
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.
๐ ๏ธ Refactor suggestion
Update GitHub Actions to latest versions.
The workflow uses older versions of GitHub Actions. Update to the latest versions for improved features and security:
Also applies to: 15-15, 40-40
๐งฐ Tools
๐ช actionlint (1.7.4)
12-12: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)