Skip to content

Commit

Permalink
chore: init
Browse files Browse the repository at this point in the history
  • Loading branch information
bubkoo committed Oct 26, 2022
1 parent b7adc16 commit 673c23f
Show file tree
Hide file tree
Showing 20 changed files with 1,599 additions and 1,670 deletions.
10 changes: 6 additions & 4 deletions .editorconfig
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# http://editorconfig.org
# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false
Expand Down
40 changes: 1 addition & 39 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,41 +1,3 @@
{
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint",
"eslint-comments",
"import",
"prettier",
"promise"
],
"extends": [
"airbnb-base",
"eslint:recommended",
"prettier",
"plugin:@typescript-eslint/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:promise/recommended",
"plugin:prettier/recommended"
],
"env": {
"es6": true,
"node": true,
"commonjs": true
},
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module",
"requireConfigFile": false
},
"rules": {
"no-nested-ternary": 0,
"no-inner-declarations": 0,
"import/extensions": 0,
"import/no-unresolved": 0,
"no-param-reassign": [2, { "props": false }],
"@typescript-eslint/no-namespace": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/explicit-module-boundary-types": 0,
"@typescript-eslint/no-non-null-assertion": 0
}
"extends": "@bubkoo/eslint-config"
}
12 changes: 10 additions & 2 deletions .github/workflows/auto-assign.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: 🚧 Install
run: |
yarn
Expand All @@ -19,4 +19,12 @@ jobs:
- uses: ./
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CONFIG_FILE: .github/workflows/config/auto-assign.yml
addReviewers: true
addAssignees: author
reviewers: |
bubkoo
bubkoo
bubkoo
numberOfReviewers: 1
skipKeywords: |
wip
32 changes: 0 additions & 32 deletions .github/workflows/config/auto-assign.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: ⤵️ Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: 🚧 Install
run: yarn install
Expand Down
23 changes: 10 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
node_modules
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
coverage
*.lcov
.DS_Store
.idea
.vscode
.nyc_output
.npm
.env
.env.test
.cache
.DS_Store
lib
.vscode
npm-debug.log
yarn-error.log
node_modules
dist
es
lib
test/coverage
2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn commitlint --edit "$1"
npx @commitlint/cli --extends @bubkoo/commitlint-config --edit "$1"
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged
npx lint-staged
28 changes: 26 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
dist/
*.md
*.sh
*.yml
*.svg
*.gif
.DS_Store
.gitignore
.npmignore
.prettierignore
.babelrc
.editorconfig
.eslintrc
.eslintignore
.stylelintrc.json
package.json
tsconfig.json
tslint.json
CNAME
LICENSE
lib/
node_modules/
es/
dist/
coverage/
yarn.lock
yarn-error.log
npm-debug.log
lerna-debug.log
5 changes: 4 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@
"printWidth": 80,
"trailingComma": "all",
"proseWrap": "never",
"overrides": [{ "files": ".prettierrc", "options": { "parser": "json" } }]
"overrides": [
{ "files": ".eslintrc", "options": { "parser": "json" } },
{ "files": ".prettierrc", "options": { "parser": "json" } }
]
}
78 changes: 23 additions & 55 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1 align="center">Auto Assign</h1>
<p align="center"><strong>Automatically add reviewers/assignees to issues/PRs when issues/PRs are opened</strong></p>
<p align="center"><strong>Automatically add reviewers/assignees to issues/PRs</strong></p>

## Features

Expand All @@ -15,17 +15,22 @@ Create `.github/workflows/auto-assign.yml` in the default branch:
name: Auto Assign
on:
issues:
types: [opened]
types: [opened, edited, labeled, unlabeled]
pull_request:
types: [opened]
types: [opened, edited, labeled, unlabeled]
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: wow-actions/auto-assign@v1
- uses: wow-actions/auto-assign@v2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CONFIG_FILE: config-file-path
reviewers: |
reviewer1
reviewer2
reviewer3
assignees: assignee1, assignee2, assignee3
skipKeywords: wip, draft
```
### Inputs
Expand All @@ -34,57 +39,20 @@ Various inputs are defined to let you configure the action:
> Note: [Workflow command and parameter names are not case-sensitive](https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#about-workflow-commands).
- `GITHUB_TOKEN`: Your GitHub token for authentication.
- `CONFIG_FILE`: Path to configuration file. Custom config will [deep merged](https://lodash.com/docs/4.17.15#merge) with the following default config:
| Name | Description | Default |
|---------------------|-----------------------------------------------------------------------------------------------------------|---------|
| `GITHUB_TOKEN` | The GitHub token for authentication | N/A |
| `addReviewers` | Set to `true` to add reviewers to PRs. | `true` |
| `addAssignees` | Set to `true` to add assignees to issues/PRs. Set to `'author'` to add issue/PR's author as a assignee. | `true` |
| `reviewers` | A list of reviewers(GitHub user name) to be added to PR. | `[]` |
| `assignees` | A list of assignees(GitHub user name) to be added to issue/PR. Uses `reviewers` if not set. file | `[]` |
| `numberOfReviewers` | Number of reviewers added to the PR. Set `0` to add all the reviewers. | `0` |
| `numberOfAssignees` | Number of assignees added to the PR. Set `0` to add all the assignees. Uses `numberReviewers` if not set. | `0` |
| `skipDraft` | Set to `false` to run on draft PRs. | `true` |
| `skipKeywords` | A list of keywords to be skipped the process if issue/PR's title include it. | `[]` |
| `includeLabels` | Only to run when issue/PR has one of the label. | `[]` |
| `excludeLabels` | Not to run when issue/PR has one of the label. | `[]` |

```js
{
addReviewers: true,
addAssignees: true,
reviewers: undefined,
assignees: undefined,
numberOfAssignees: 0,
numberOfReviewers: 0,
skipKeywords: undefined,
reviewGroups: undefined,
assigneeGroups: undefined,
}
```

## Config

```yaml
# Set to true to add reviewers to issues/PRs
addReviewers: true
# Set to true to add assignees to issues/PRs
addAssignees: true
# Set to 'author' to add issue's/PR's author as a assignee
# addAssignees: author
# A list of reviewers to be added to issues/PRs (GitHub user name)
reviewers:
- reviewerA
- reviewerB
- reviewerC
# A number of reviewers added to the issues/PRs
# Set 0 to add all the reviewers (default: 0)
numberOfReviewers: 0
# A list of assignees, overrides reviewers if set
# assignees:
# - assigneeA
# A number of assignees to add to the issues/PRs
# Set to 0 to add all of the assignees.
# Uses numberOfReviewers if unset.
# numberOfAssignees: 2
# A list of keywords to be skipped the process if issue/PR's title include it
# skipKeywords:
# - wip
```

## License

Expand Down
43 changes: 39 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,51 @@
name: Auto Assign Issues/PRs
description: Automatically add reviewers/assignees to issues/PRs when issues/PRs are opened.
description: Automatically add reviewers/assignees to issues/PRs.
author: bubkoo <[email protected]>
inputs:
GITHUB_TOKEN:
description: Your GitHub token for authentication
description: Your GitHub token for authentication.
required: true
CONFIG_FILE:
description: Config file path relative to your repo's root.
addReviewers:
description: Set to true to add reviewers to PRs.
required: false
default: true
addAssignees:
description: Set to true to add assignees to PRs. Set to 'author' to add PR's author as a assignee.
required: false
default: author
reviewers:
description: A list of reviewers(GitHub user name) to be added to PRs.
required: false
assignees:
description: A list of assignees(GitHub user name) to be added to issue/PR. Uses `reviewers` if not set.
required: false
numberOfReviewers:
description: Number of reviewers added to the PR. Set `0` to add all the reviewers (default `0`).
required: false
default: 0
numberOfAssignees:
description: Number of assignees added to the PR. Set `0` to add all the assignees (default `0`). Uses `numberReviewers` if not set.
required: false
default: 0
skipKeywords:
description: A list of keywords to be skipped the process if PR's title include it.
required: false
skipDraft:
description: Set to `false` to run on draft PRs.
required: false
default: true
includeLabels:
description: Only to run when issue/PR has one of the label.
required: false
excludeLabels:
description: Not to run when issue/PR has one of the label.
required: false


runs:
using: node16
main: dist/index.js

branding:
icon: flag
color: black # gray-dark purple red orange green blue yellow black white
Loading

0 comments on commit 673c23f

Please sign in to comment.