Skip to content

Commit 3f10381

Browse files
authored
Merge pull request #8 from kc3hack/NHK-8
[NHK-8] レビューCIの修正
2 parents 5659c36 + 37c16da commit 3f10381

File tree

4 files changed

+45
-139
lines changed

4 files changed

+45
-139
lines changed

.github/CODEOWNERS

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# デフォルトのレビュワー(全てのファイルに対して)
2+
* @bearl27
3+
4+
# バックエンドのレビュワー
5+
/backend/ @kubodayo @yone-al
6+
7+
# フロントエンドのレビュワー
8+
/frontend/ @KZ-a-k @IRyoma

.github/labeler.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
back:
2+
- changed-files:
3+
- any-glob-to-any-file: 'backend/**/*'
4+
5+
front:
6+
- changed-files:
7+
- any-glob-to-any-file: 'frontend/**/*'
8+
9+
documentation:
10+
- changed-files:
11+
- any-glob-to-any-file: ['*.md', 'docs/**/*']
12+
13+
github-actions:
14+
- changed-files:
15+
- any-glob-to-any-file: '.github/**/*'
Lines changed: 17 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,29 @@
1-
name: Auto Label and Assign Reviewer
1+
name: Auto Label and Assign
22

33
on:
44
pull_request:
5-
types: [opened, ready_for_review]
5+
types: [opened, synchronize]
66

77
jobs:
8-
label_and_assign:
8+
auto_label:
99
runs-on: ubuntu-latest
1010
permissions:
1111
contents: read
1212
pull-requests: write
1313
steps:
14-
- name: Auto Label and Assign Reviewer
15-
uses: actions/github-script@v7
14+
- name: Auto Label
15+
uses: actions/labeler@v6.0.1
1616
with:
17-
github-token: ${{ secrets.GITHUB_TOKEN }}
18-
script: |
19-
const branchName = context.payload.pull_request.head.ref;
20-
const prNumber = context.payload.pull_request.number;
21-
const owner = context.repo.owner;
22-
const repo = context.repo.repo;
17+
repo-token: ${{ secrets.GITHUB_TOKEN }}
2318

24-
let labelsToAdd = [];
25-
let reviewersToAdd = [];
26-
27-
// Configuration
28-
const backendReviewers = ['kubodayo', 'yone-al', 'bearl27'];
29-
const frontendReviewers = ['KZ-a-k', 'IRyoma', 'bearl27'];
30-
const otherReviewers = ['kc3hack/2026_10'];
31-
32-
if (branchName.startsWith('BE-')) {
33-
labelsToAdd.push('back');
34-
reviewersToAdd = backendReviewers;
35-
} else if (branchName.startsWith('FE-')) {
36-
labelsToAdd.push('front');
37-
reviewersToAdd = frontendReviewers;
38-
} else {
39-
labelsToAdd.push('other');
40-
reviewersToAdd = otherReviewers;
41-
}
42-
43-
if (labelsToAdd.length > 0) {
44-
await github.rest.issues.addLabels({
45-
owner,
46-
repo,
47-
issue_number: prNumber,
48-
labels: labelsToAdd
49-
});
50-
console.log(`Added labels: ${labelsToAdd.join(', ')}`);
51-
}
52-
53-
if (reviewersToAdd.length > 0) {
54-
try {
55-
await github.rest.pulls.requestReviewers({
56-
owner,
57-
repo,
58-
pull_number: prNumber,
59-
reviewers: reviewersToAdd
60-
});
61-
console.log(`Requested reviewers: ${reviewersToAdd.join(', ')}`);
62-
} catch (error) {
63-
console.error('Error requesting reviewers:', error);
64-
}
65-
}
66-
67-
// Auto-assign PR creator as assignee
68-
const prCreator = context.payload.pull_request.user.login;
69-
try {
70-
await github.rest.issues.addAssignees({
71-
owner,
72-
repo,
73-
issue_number: prNumber,
74-
assignees: [prCreator]
75-
});
76-
console.log(`Assigned PR creator: ${prCreator}`);
77-
} catch (error) {
78-
console.error('Error assigning PR creator:', error);
79-
}
19+
auto_assign:
20+
runs-on: ubuntu-latest
21+
permissions:
22+
contents: read
23+
pull-requests: write
24+
issues: write
25+
steps:
26+
- name: Auto Assign Author
27+
uses: toshimaru/auto-author-assign@v3.0.1
28+
with:
29+
repo-token: ${{ secrets.GITHUB_TOKEN }}

frontend/README.md

Lines changed: 5 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,6 @@
1-
# React + TypeScript + Vite
1+
# Frontend
2+
立ち上げ方
23

3-
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4-
5-
Currently, two official plugins are available:
6-
7-
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh
8-
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9-
10-
## React Compiler
11-
12-
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
13-
14-
## Expanding the ESLint configuration
15-
16-
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
17-
18-
```js
19-
export default defineConfig([
20-
globalIgnores(['dist']),
21-
{
22-
files: ['**/*.{ts,tsx}'],
23-
extends: [
24-
// Other configs...
25-
26-
// Remove tseslint.configs.recommended and replace with this
27-
tseslint.configs.recommendedTypeChecked,
28-
// Alternatively, use this for stricter rules
29-
tseslint.configs.strictTypeChecked,
30-
// Optionally, add this for stylistic rules
31-
tseslint.configs.stylisticTypeChecked,
32-
33-
// Other configs...
34-
],
35-
languageOptions: {
36-
parserOptions: {
37-
project: ['./tsconfig.node.json', './tsconfig.app.json'],
38-
tsconfigRootDir: import.meta.dirname,
39-
},
40-
// other options...
41-
},
42-
},
43-
])
44-
```
45-
46-
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
47-
48-
```js
49-
// eslint.config.js
50-
import reactX from 'eslint-plugin-react-x'
51-
import reactDom from 'eslint-plugin-react-dom'
52-
53-
export default defineConfig([
54-
globalIgnores(['dist']),
55-
{
56-
files: ['**/*.{ts,tsx}'],
57-
extends: [
58-
// Other configs...
59-
// Enable lint rules for React
60-
reactX.configs['recommended-typescript'],
61-
// Enable lint rules for React DOM
62-
reactDom.configs.recommended,
63-
],
64-
languageOptions: {
65-
parserOptions: {
66-
project: ['./tsconfig.node.json', './tsconfig.app.json'],
67-
tsconfigRootDir: import.meta.dirname,
68-
},
69-
// other options...
70-
},
71-
},
72-
])
73-
```
4+
```bash
5+
npm run dev
6+
```

0 commit comments

Comments
 (0)