Compare commits

..

13 Commits

Author SHA1 Message Date
Ross Brodbeck
6e742474aa Add more tests 2020-04-16 13:51:24 -04:00
Ross Brodbeck
420680dd9b Fix test cases to return the right pagination 2020-04-16 13:36:59 -04:00
Ross Brodbeck
6c28e8b071 Fix linting rules 2020-04-16 11:47:26 -04:00
Ross Brodbeck
2893271b29 Move processor to use its own types so testing is easier 2020-04-16 11:47:06 -04:00
Ross Brodbeck
e83d301625 Add our first real test 2020-04-16 10:48:59 -04:00
Ross Brodbeck
dbb0a7494e Merge back multi issue changes and allow for injection of issues 2020-04-16 10:10:14 -04:00
Ross Brodbeck
d7719d70c7 Pack for distribution 2020-04-16 09:56:52 -04:00
Ross Brodbeck
f11770a586 Pack for distribution 2020-04-16 09:56:52 -04:00
Ross Brodbeck
89d925e4d0 Fix operations per run 2020-04-16 09:56:52 -04:00
Ross Brodbeck
84ccaafbed Fix linting and pack for distribution 2020-04-16 09:56:52 -04:00
Ross Brodbeck
4a0411b89b Add debugging documentation 2020-04-16 09:55:42 -04:00
Ross Brodbeck
cff99ee7cd Add debug mode to action definition 2020-04-16 09:55:42 -04:00
Ross Brodbeck
4677ee2b0f Refctor into an issue processor, add debug mode 2020-04-16 09:55:42 -04:00
4 changed files with 1 additions and 66 deletions

View File

@@ -1,26 +0,0 @@
name: "Build"
on: # rebuild any PRs and main branch changes
pull_request:
push:
branches:
- master
- 'releases/*'
jobs:
build: # make sure build/ci work properly
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
npm install
npm run all
test: # make sure the action works on a clean machine without building
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is stale'
stale-pr-message: 'This PR is stale'
debug-only: true

View File

@@ -2,23 +2,6 @@
Warns and then closes issues and PRs that have had no activity for a specified amount of time.
### Building and testing
Install the dependencies
```bash
$ npm install
```
Build the typescript and package it for distribution
```bash
$ npm run build && npm run pack
```
Run the tests :heavy_check_mark:
```bash
$ npm test
```
### Usage
See [action.yml](./action.yml) For comprehensive list of options.

View File

@@ -178,25 +178,3 @@ test('exempt pr labels will not be marked stale', async () => {
expect(processor.staleIssues.length).toEqual(2); // PR should get processed even though it has an exempt **issue** label
});
test('stale issues should not be closed if days is set to -1', async () => {
const TestIssueList: Issue[] = [
generateIssue(1, 'My first issue', '2020-01-01T17:00:00Z', false, [
'Stale'
]),
generateIssue(2, 'My first PR', '2020-01-01T17:00:00Z', true, ['Stale']),
generateIssue(3, 'Another issue', '2020-01-01T17:00:00Z', false, ['Stale'])
];
let opts = DefaultProcessorOptions;
opts.daysBeforeClose = -1;
const processor = new IssueProcessor(DefaultProcessorOptions, async p =>
p == 1 ? TestIssueList : []
);
// process our fake issue list
await processor.processIssues(1);
expect(processor.closedIssues.length).toEqual(0);
});

View File

@@ -25,7 +25,7 @@ inputs:
description: 'The label to apply when a pull request is stale.'
default: 'Stale'
exempt-pr-labels:
description: 'The labels to apply when a pull request is exempt from being marked stale. Separate multiple labels with commas (eg. "label1,label2")'
description: 'The labels to apply when a pull request is exempt from being marked stale. Separate multiple labels with commas (eg. "label1,label2")''
default: ''
only-labels:
description: 'Only issues or pull requests with all of these labels are checked if stale. Defaults to `[]` (disabled) and can be a comma-separated list of labels.'