Skip to content
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

Jay so step3 #12

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
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
37 changes: 37 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"env": {
"browser": true,
"node": true,
"es2021": true
},
"extends": ["airbnb-base", "plugin:prettier/recommended"],
"plugins": ["prettier"],
"parserOptions": {
"ecmaVersion": 2022,
"sourceType": "module"
},
"rules": {
"prettier/prettier": [
"error",
{
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"printWidth": 80,
"trailingComma": "es5",
"arrowParens": "always"
}
],
"no-console": "off",
"no-unused-vars": ["warn"],
"import/extensions": [
"error",
{
"js": "never",
"jsx": "never",
"mjs": "always"
}
],
"class-methods-use-this": ["off"]
}
}
24 changes: 17 additions & 7 deletions .github/workflows/RandomReviewer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,34 @@ jobs:
- id: random_reviwer
uses: actions/github-script@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const candidate = ['jay-so', 'iey704', 'yerimming', 'makeUgreat', 'jiminseong'];
const randomReviewer = candidate[Math.floor(Math.random() * candidate.length)];
const comment = `@${randomReviewer} 님 랜덤 리뷰어로 당첨되셨습니다! 리뷰를 부탁드립니다. 🙏`;
console.log(`Comment: ${comment}`);
return { comment, reviewer: randomReviewer };

- name: comment PR
uses: mshick/add-pr-comment@v1
uses: actions/github-script@v5
with:
message: |
${{ steps.random_reviwer.outputs.comment }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-token-user-login: 'github-actions[bot]'
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const reviewer = '${{ steps.random_reviwer.outputs.reviewer }}';
const comment = `@${reviewer} 님 랜덤 리뷰어로 당첨되셨습니다! 리뷰를 부탁드립니다. 🙏`;

const { owner, repo } = context.repo;
const issue_number = context.issue.number;

await github.rest.issues.createComment({
owner,
repo,
issue_number,
body: comment
});

- name: Add Pull Request Reviewer
uses: madrapps/add-reviewers@v1
with:
reviewers: ${{ steps.random_reviwer.outputs.reviewer }}
token: ${{ secrets.GITHUB_TOKEN }}

7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"printWidth": 80,
"trailingComma": "es5"
}
Binary file added images/플로우 차트.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading