mirror of
https://github.com/actions/stale.git
synced 2025-12-26 02:08:18 +00:00
Compare commits
5 Commits
refactor_p
...
v2.0.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a23bda33c4 | ||
|
|
78921b6863 | ||
|
|
29c3838f9a | ||
|
|
ae12f32ff1 | ||
|
|
aad6ffa865 |
26
.github/workflows/test.yml
vendored
Normal file
26
.github/workflows/test.yml
vendored
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
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
|
||||||
17
README.md
17
README.md
@@ -2,6 +2,23 @@
|
|||||||
|
|
||||||
Warns and then closes issues and PRs that have had no activity for a specified amount of time.
|
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
|
### Usage
|
||||||
|
|
||||||
See [action.yml](./action.yml) For comprehensive list of options.
|
See [action.yml](./action.yml) For comprehensive list of options.
|
||||||
|
|||||||
@@ -178,3 +178,25 @@ 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
|
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);
|
||||||
|
});
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ inputs:
|
|||||||
description: 'The label to apply when a pull request is stale.'
|
description: 'The label to apply when a pull request is stale.'
|
||||||
default: 'Stale'
|
default: 'Stale'
|
||||||
exempt-pr-labels:
|
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: ''
|
default: ''
|
||||||
only-labels:
|
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.'
|
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.'
|
||||||
|
|||||||
Reference in New Issue
Block a user