mirror of
https://github.com/actions/stale.git
synced 2025-12-25 09:58:16 +00:00
Compare commits
13 Commits
v2
...
refactor_p
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6e742474aa | ||
|
|
420680dd9b | ||
|
|
6c28e8b071 | ||
|
|
2893271b29 | ||
|
|
e83d301625 | ||
|
|
dbb0a7494e | ||
|
|
d7719d70c7 | ||
|
|
f11770a586 | ||
|
|
89d925e4d0 | ||
|
|
84ccaafbed | ||
|
|
4a0411b89b | ||
|
|
cff99ee7cd | ||
|
|
4677ee2b0f |
26
.github/workflows/test.yml
vendored
26
.github/workflows/test.yml
vendored
@@ -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
|
|
||||||
17
README.md
17
README.md
@@ -2,23 +2,6 @@
|
|||||||
|
|
||||||
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,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
|
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.'
|
||||||
|
|||||||
2018
dist/index.js
vendored
2018
dist/index.js
vendored
File diff suppressed because it is too large
Load Diff
65
package-lock.json
generated
65
package-lock.json
generated
@@ -10,19 +10,54 @@
|
|||||||
"integrity": "sha512-Wp4xnyokakM45Uuj4WLUxdsa8fJjKVl1fDTsPbTEcTcuu0Nb26IPQbOtjmnfaCPGcaoPOOqId8H9NapZ8gii4w=="
|
"integrity": "sha512-Wp4xnyokakM45Uuj4WLUxdsa8fJjKVl1fDTsPbTEcTcuu0Nb26IPQbOtjmnfaCPGcaoPOOqId8H9NapZ8gii4w=="
|
||||||
},
|
},
|
||||||
"@actions/github": {
|
"@actions/github": {
|
||||||
"version": "2.2.0",
|
"version": "2.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/github/-/github-2.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/github/-/github-2.1.1.tgz",
|
||||||
"integrity": "sha512-9UAZqn8ywdR70n3GwVle4N8ALosQs4z50N7XMXrSTUVOmVpaBC5kE3TRTT7qQdi3OaQV24mjGuJZsHUmhD+ZXw==",
|
"integrity": "sha512-kAgTGUx7yf5KQCndVeHSwCNZuDBvPyxm5xKTswW2lofugeuC1AZX73nUUVDNaysnM9aKFMHv9YCdVJbg7syEyA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@actions/http-client": "^1.0.3",
|
"@actions/http-client": "^1.0.3",
|
||||||
"@octokit/graphql": "^4.3.1",
|
"@octokit/graphql": "^4.3.1",
|
||||||
"@octokit/rest": "^16.43.1"
|
"@octokit/rest": "^16.43.1"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@octokit/request-error": {
|
||||||
|
"version": "1.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-1.2.1.tgz",
|
||||||
|
"integrity": "sha512-+6yDyk1EES6WK+l3viRDElw96MvwfJxCt45GvmjDUKWjYIb3PJZQkq3i46TwGwoPD4h8NmTrENmtyA1FwbmhRA==",
|
||||||
|
"requires": {
|
||||||
|
"@octokit/types": "^2.0.0",
|
||||||
|
"deprecation": "^2.0.0",
|
||||||
|
"once": "^1.4.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@octokit/rest": {
|
||||||
|
"version": "16.43.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-16.43.1.tgz",
|
||||||
|
"integrity": "sha512-gfFKwRT/wFxq5qlNjnW2dh+qh74XgTQ2B179UX5K1HYCluioWj8Ndbgqw2PVqa1NnVJkGHp2ovMpVn/DImlmkw==",
|
||||||
|
"requires": {
|
||||||
|
"@octokit/auth-token": "^2.4.0",
|
||||||
|
"@octokit/plugin-paginate-rest": "^1.1.1",
|
||||||
|
"@octokit/plugin-request-log": "^1.0.0",
|
||||||
|
"@octokit/plugin-rest-endpoint-methods": "2.4.0",
|
||||||
|
"@octokit/request": "^5.2.0",
|
||||||
|
"@octokit/request-error": "^1.0.2",
|
||||||
|
"atob-lite": "^2.0.0",
|
||||||
|
"before-after-hook": "^2.0.0",
|
||||||
|
"btoa-lite": "^1.0.0",
|
||||||
|
"deprecation": "^2.0.0",
|
||||||
|
"lodash.get": "^4.4.2",
|
||||||
|
"lodash.set": "^4.3.2",
|
||||||
|
"lodash.uniq": "^4.5.0",
|
||||||
|
"octokit-pagination-methods": "^1.1.0",
|
||||||
|
"once": "^1.4.0",
|
||||||
|
"universal-user-agent": "^4.0.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@actions/http-client": {
|
"@actions/http-client": {
|
||||||
"version": "1.0.8",
|
"version": "1.0.7",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.8.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.7.tgz",
|
||||||
"integrity": "sha512-G4JjJ6f9Hb3Zvejj+ewLLKLf99ZC+9v+yCxoYf9vSyH+WkzPLB2LuUtRMGNkooMqdugGBFStIKXOuvH1W+EctA==",
|
"integrity": "sha512-PY3ys/XH5WMekkHyZhYSa/scYvlE5T/TV/T++vABHuY5ZRgtiBZkn2L2tV5Pv/xDCl59lSZb9WwRuWExDyAsSg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"tunnel": "0.0.6"
|
"tunnel": "0.0.6"
|
||||||
}
|
}
|
||||||
@@ -522,23 +557,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@octokit/graphql": {
|
"@octokit/graphql": {
|
||||||
"version": "4.4.0",
|
"version": "4.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.3.1.tgz",
|
||||||
"integrity": "sha512-Du3hAaSROQ8EatmYoSAJjzAz3t79t9Opj/WY1zUgxVUGfIKn0AEjg+hlOLscF6fv6i/4y/CeUvsWgIfwMkTccw==",
|
"integrity": "sha512-hCdTjfvrK+ilU2keAdqNBWOk+gm1kai1ZcdjRfB30oA3/T6n53UVJb7w0L5cR3/rhU91xT3HSqCd+qbvH06yxA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@octokit/request": "^5.3.0",
|
"@octokit/request": "^5.3.0",
|
||||||
"@octokit/types": "^2.0.0",
|
"@octokit/types": "^2.0.0",
|
||||||
"universal-user-agent": "^5.0.0"
|
"universal-user-agent": "^4.0.0"
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"universal-user-agent": {
|
|
||||||
"version": "5.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-5.0.0.tgz",
|
|
||||||
"integrity": "sha512-B5TPtzZleXyPrUMKCpEHFmVhMN6EhmJYjG5PQna9s7mXeSqGTLap4OpqLl5FCEFUI3UBmllkETwKf/db66Y54Q==",
|
|
||||||
"requires": {
|
|
||||||
"os-name": "^3.1.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@octokit/plugin-paginate-rest": {
|
"@octokit/plugin-paginate-rest": {
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.2.3",
|
"@actions/core": "^1.2.3",
|
||||||
"@actions/github": "^2.2.0",
|
"@actions/github": "^2.1.1",
|
||||||
"@octokit/rest": "^16.43.1",
|
"@octokit/rest": "^16.43.1",
|
||||||
"semver": "^6.1.1"
|
"semver": "^6.1.1"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user