Skip to content

Commit

Permalink
feat: flag that aborts action if previous assignees (#77)
Browse files Browse the repository at this point in the history
* feat: abortIfPreviousAssignees flag

* build: bumped dependencies

* feat: improved logs

* feat: improved logs

* fix: updated getIssueMockForPR

* debug: output context

* feat: optimized issue loading

* fix: removed log

* ci: updated 3rd party actions

* feat: refactored utilities and tests

* fix: fixed bug with mocks data rentention
  • Loading branch information
pozil authored Oct 13, 2022
1 parent c83b03e commit 74b9f64
Show file tree
Hide file tree
Showing 38 changed files with 641 additions and 1,031 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 'Checkout source code'
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: 'Restore node_modules cache'
id: cache-npm
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: node_modules
key: npm-${{ hashFiles('**/package-lock.json') }}
Expand All @@ -37,4 +37,4 @@ jobs:
run: npm run test:coverage

- name: 'Upload code coverage to Codecov.io'
uses: codecov/codecov-action@v2.0.2
uses: codecov/codecov-action@v3
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@

## Inputs

| Parameter | Type | Required | Description |
| ------------------------- | ------- | ------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `assignees` | String | only if `teams` is not specified | Comma separated list of user names. Issue will be assigned to those users. |
| `teams` | String | only if `assignees` is not specified | Comma separated list of teams. Issue will be assigned to the team members.<br/><br/>**Important Requirement:** if using the `teams` input parameter, you need to use a personal access token with `read:org` scope (the default `GITHUB_TOKEN` is not enough). |
| `numOfAssignee` | Number | false | Number of assignees that will be randomly picked from the teams or assignees. If not specified, assigns all users. |
| `removePreviousAssignees` | Boolean | false | Flag that removes assignees before assigning them (useful the issue is reasigned). False by default. |
| `allowNoAssignees` | Boolean | false | Flag that prevents the action from failing when there are no assignees. False by default. |
| `allowSelfAssign` | Boolean | false | Flag that allows self-assignment to the issue author. True by default.<br/><br/>This flag is ignored when working with PRs as self assigning a PR for review is forbidden by GitHub. |
| Parameter | Type | Required | Description |
| -------------------------- | ------- | ------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `assignees` | String | only if `teams` is not specified | Comma separated list of user names. Issue will be assigned to those users. |
| `teams` | String | only if `assignees` is not specified | Comma separated list of teams. Issue will be assigned to the team members.<br/><br/>**Important Requirement:** if using the `teams` input parameter, you need to use a personal access token with `read:org` scope (the default `GITHUB_TOKEN` is not enough). |
| `numOfAssignee` | Number | false | Number of assignees that will be randomly picked from the teams or assignees. If not specified, assigns all users. |
| `abortIfPreviousAssignees` | Boolean | false | Flag that aborts the action if there were assignees previously. False by default. |
| `removePreviousAssignees` | Boolean | false | Flag that removes assignees before assigning them (useful the issue is reasigned). False by default. |
| `allowNoAssignees` | Boolean | false | Flag that prevents the action from failing when there are no assignees. False by default. |
| `allowSelfAssign` | Boolean | false | Flag that allows self-assignment to the issue author. True by default.<br/><br/>This flag is ignored when working with PRs as self assigning a PR for review is forbidden by GitHub. |

## Examples

Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ inputs:
numOfAssignee:
description: 'Number of random assignee'
required: false
abortIfPreviousAssignees:
description: 'Flag that aborts the action if there were assignees previously.'
required: false
default: false
removePreviousAssignees:
description: 'Flag that removes assignees before assigning them (useful the issue is reasigned).'
required: false
Expand Down
33 changes: 11 additions & 22 deletions node_modules/.package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions node_modules/@eslint/eslintrc/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions node_modules/@eslint/eslintrc/dist/eslintrc.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion node_modules/@eslint/eslintrc/dist/eslintrc.cjs.map

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion node_modules/@eslint/eslintrc/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 74b9f64

Please sign in to comment.