File tree Expand file tree Collapse file tree 7 files changed +1924
-1932
lines changed Expand file tree Collapse file tree 7 files changed +1924
-1932
lines changed Original file line number Diff line number Diff line change 19
19
steps:
20
20
- uses: actions/checkout@v2
21
21
- uses: ./
22
+ id: stale
22
23
with:
23
24
stale-issue-message: 'This issue is stale'
24
25
stale-pr-message: 'This PR is stale'
25
26
debug-only: true
27
+ - name: print outputs
28
+ run: echo ${{ join(steps.stale.outputs.*, ',') }}
Original file line number Diff line number Diff line change @@ -21,19 +21,19 @@ $ npm test
21
21
Run the tests and display only the first failing tests :heavy_check_mark:
22
22
23
23
```bash
24
- $ npm test:only-errors
24
+ $ npm run test:only-errors
25
25
```
26
26
27
27
Run the tests with the watch mode :heavy_check_mark:
28
28
29
29
```bash
30
- $ npm test:watch
30
+ $ npm run test:watch
31
31
```
32
32
33
33
Run the linter and fix (almost) every issue for you :heavy_check_mark:
34
34
35
35
```bash
36
- $ npm lint:all:fix
36
+ $ npm run lint:all:fix
37
37
```
38
38
39
39
# Before creating a PR
@@ -43,7 +43,7 @@ $ npm lint:all:fix
43
43
Build, lint, package and test everything.
44
44
45
45
```bash
46
- $ npm all
46
+ $ npm run all
47
47
```
48
48
49
49
# Release
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ The default configuration will:
10
10
11
11
## All options
12
12
13
- ### List of options
13
+ ### List of input options
14
14
15
15
Every argument is optional.
16
16
@@ -61,6 +61,13 @@ Every argument is optional.
61
61
| [exempt-all-pr-assignees](#exempt-all-pr-assignees) | Override [exempt-all-assignees](#exempt-all-assignees) for PRs only | |
62
62
| [enable-statistics](#enable-statistics) | Display statistics in the logs | `true` |
63
63
64
+ ### List of output options
65
+
66
+ | Output | Description |
67
+ | ----------------- | -------------------------------------------- |
68
+ | staled-issues-prs | List of all staled issues and pull requests. |
69
+ | closed-issues-prs | List of all closed issues and pull requests. |
70
+
64
71
### Detailed options
65
72
66
73
#### repo-token
Original file line number Diff line number Diff line change @@ -168,6 +168,11 @@ inputs:
168
168
description: 'Display some statistics at the end regarding the stale workflow (only when the logs are enabled).'
169
169
default: 'true'
170
170
required: false
171
+ outputs:
172
+ closed-issues-prs:
173
+ description: 'List of all closed issues and pull requests.'
174
+ staled-issues-prs:
175
+ description: 'List of all staled issues and pull requests.'
171
176
runs:
172
177
using: 'node12'
173
178
main: 'dist/index.js'
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change @@ -2,12 +2,19 @@ import * as core from '@actions/core';
2
2
import {IssuesProcessor} from './classes/issues-processor';
3
3
import {isValidDate} from './functions/dates/is-valid-date';
4
4
import {IIssuesProcessorOptions} from './interfaces/issues-processor-options';
5
+ import {Issue} from './classes/issue';
5
6
6
7
async function _run(): Promise<void> {
7
8
try {
8
9
const args = _getAndValidateArgs();
9
10
10
- await new IssuesProcessor(args).processIssues();
11
+ const issueProcessor: IssuesProcessor = new IssuesProcessor(args);
12
+ await issueProcessor.processIssues();
13
+
14
+ await processOutput(
15
+ issueProcessor.closedIssues,
16
+ issueProcessor.staleIssues
17
+ );
11
18
} catch (error) {
12
19
core.error(error);
13
20
core.setFailed(error.message);
@@ -103,6 +110,14 @@ function _getAndValidateArgs(): IIssuesProcessorOptions {
103
110
return args;
104
111
}
105
112
113
+ async function processOutput(
114
+ staledIssues: Issue[],
115
+ closedIssues: Issue[]
116
+ ): Promise<void> {
117
+ core.setOutput('staled-issues-prs', JSON.stringify(staledIssues));
118
+ core.setOutput('closed-issues-prs', JSON.stringify(closedIssues));
119
+ }
120
+
106
121
function _toOptionalBoolean(
107
122
argumentName: Readonly<string>
108
123
): boolean | undefined {
You can’t perform that action at this time.
0 commit comments