Skip to content

Commit 1e9625a

Browse files
committed
Initial commit for v6
1 parent 770989b commit 1e9625a

23 files changed

Lines changed: 10018 additions & 5701 deletions

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,6 @@ insert_final_newline = true
1818

1919
[*.md]
2020
trim_trailing_whitespace = false
21+
22+
[*.py]
23+
indent_size = 4

.eslintrc.yml

Lines changed: 52 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,54 @@
1-
env:
2-
node: true
3-
es6: false
4-
jest: true
5-
commonjs: true
1+
---
62
extends:
7-
- google
8-
- 'plugin:prettier/recommended'
9-
globals:
10-
Atomics: readonly
11-
SharedArrayBuffer: readonly
12-
parserOptions:
13-
ecmaVersion: 2019
14-
sourceType: script
3+
- eslint:recommended
4+
- plugin:node/recommended
5+
- prettier
156
plugins:
16-
- prettier
17-
rules: {}
7+
- node
8+
- prettier
9+
rules:
10+
prettier/prettier: error
11+
block-scoped-var: error
12+
eqeqeq: error
13+
no-var: error
14+
prefer-const: error
15+
eol-last: error
16+
prefer-arrow-callback: error
17+
no-trailing-spaces: error
18+
quotes:
19+
- warn
20+
- single
21+
- avoidEscape: true
22+
no-restricted-properties:
23+
- error
24+
- object: describe
25+
property: only
26+
- object: it
27+
property: only
28+
overrides:
29+
- files:
30+
- "**/*.ts"
31+
- "**/*.tsx"
32+
parser: "@typescript-eslint/parser"
33+
extends:
34+
- plugin:@typescript-eslint/recommended
35+
rules:
36+
"@typescript-eslint/no-non-null-assertion": 'off'
37+
"@typescript-eslint/no-use-before-define": 'off'
38+
"@typescript-eslint/no-warning-comments": 'off'
39+
"@typescript-eslint/no-empty-function": 'off'
40+
"@typescript-eslint/no-var-requires": 'off'
41+
"@typescript-eslint/explicit-function-return-type": 'off'
42+
"@typescript-eslint/explicit-module-boundary-types": 'off'
43+
"@typescript-eslint/ban-types": 'off'
44+
"@typescript-eslint/camelcase": 'off'
45+
node/no-missing-import: 'off'
46+
node/no-empty-function: 'off'
47+
node/no-unsupported-features/es-syntax: 'off'
48+
node/no-missing-require: 'off'
49+
node/shebang: 'off'
50+
no-dupe-class-members: 'off'
51+
require-atomic-updates: 'off'
52+
parserOptions:
53+
ecmaVersion: 2018
54+
sourceType: module

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@ report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
1313
.env
1414
node_modules/
1515
coverage/
16+
lib/**/*
17+
test/runner/*

.mergify.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.prettierrc.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

.prettierrc.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
bracketSpacing: true
3+
singleQuote: true
4+
trailingComma: es5
5+
arrowParens: avoid
6+
printWidth: 120

Dockerfile

Lines changed: 0 additions & 10 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,92 +1 @@
1-
# "Stale Issue Cleanup" Action for GitHub Actions
2-
3-
This GitHub action warns and then closes issues and PRs without activity
4-
after a specified amount of time. It improves upon [GitHub's original
5-
stale action](https://github.com/actions/stale) by allowing the action
6-
to run only on issues that contain a specified label, and removing labels
7-
once the issue sees new activity.
8-
9-
## Building and testing
10-
11-
Install dependencies
12-
```bash
13-
$ yarn install
14-
```
15-
16-
Run unit tests
17-
```bash
18-
$ yarn test
19-
```
20-
21-
### Local Integ Testing with Docker
22-
23-
This action is using Docker, so you can test it locally in dry run mode if you
24-
wish.
25-
26-
```bash
27-
$ docker build -t stale-issue-cleanup .
28-
$ docker run --label stale-issue-cleanup --env-file test/local-docker.env stale-issue-cleanup
29-
```
30-
31-
Check out [local-docker.env](./test/local-docker.env) to configure your local
32-
testing options. Once you're satisfied that it's working the way you expect,
33-
you can create a workflow file and implement this as an action on your repo.
34-
35-
36-
## Usage
37-
38-
You need to add a workflow file into your repository under
39-
[.github/workflows](./.github/workflows), just like any other Github Action.
40-
This workflow file [follows the standard workflow syntax for Github Actions.](https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions).
41-
42-
A sample workflow file for you to use as a drop-in is in [sample_workflow.yml](./sample_workflow.yml).
43-
44-
For a list of options and their description, see [action.yml](./action.yml).
45-
46-
Here's an abbreviated example with just the step for this action:
47-
48-
```yaml
49-
steps:
50-
- uses: aws-actions/stale-issue-cleanup@v3
51-
with:
52-
# Types of issues that will be processed
53-
issue-types: issues,pull_requests
54-
55-
# Messages this action will apply to issues
56-
stale-issue-message: Stale issue message
57-
stale-pr-message: Stale pr message
58-
ancient-issue-message: Ancient issue message
59-
ancient-pr-message: Ancient pr message
60-
61-
62-
# Labels this action will apply to issues
63-
stale-issue-label: closing-soon
64-
exempt-issue-labels: awaiting-approval
65-
stale-pr-label: no-pr-activity
66-
exempt-pr-labels: awaiting-approval
67-
response-requested-label: response-requested
68-
closed-for-staleness-label: closed-for-staleness
69-
70-
# Issue timing and upvote counting
71-
days-before-stale: 4
72-
days-before-close: 7
73-
days-before-ancient: 365
74-
minimum-upvotes-to-exempt: 10
75-
76-
# Testing/debugging options
77-
loglevel: DEBUG
78-
dry-run: true
79-
80-
# Leave this alone, or set to a PAT for the action to use
81-
repo-token: ${{ secrets.GITHUB_TOKEN }}
82-
```
83-
84-
**NOTE:** For stability, you should use the action with either an
85-
explicit tag, or commit SHA:
86-
87-
`uses: aws-actions/stale-issue-cleanup@v3`
88-
89-
## License Summary
90-
91-
This code is made available under the Apache-2.0 license.
92-
See [LICENSE](./LICENSE).
1+
TODO: redo the readme

action.yml

Lines changed: 72 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,86 @@
1+
---
12
name: "'Stale Issue Cleanup' Action for GitHub Actions"
23
description: 'Close issues and pull requests with no recent activity'
34
branding:
45
icon: 'cloud'
56
color: 'orange'
67
inputs:
7-
repo-token:
8-
description: 'Token for the repository. Can be passed in using {{ secrets.GITHUB_TOKEN }}'
9-
required: true
10-
issue-types:
11-
description: 'Issue types to process ("issues", "pull_requests", or "issues,pull_requests")'
12-
default: 'issues,pull_requests'
13-
stale-issue-message:
14-
description: 'The message to post on the issue when tagging it. If none provided, will not mark issues stale.'
15-
stale-pr-message:
16-
description: 'The message to post on the pr when tagging it. If none provided, will not mark pull requests stale.'
17-
days-before-stale:
18-
description: 'The number of days old an issue can be before marking it stale.'
19-
default: 60
20-
days-before-close:
21-
description: 'The number of days to wait to close an issue or pull request after it being marked stale.'
22-
default: 7
23-
stale-issue-label:
24-
description: 'The label to apply when an issue is stale.'
25-
default: 'Stale'
26-
exempt-issue-labels:
27-
description: 'The labels to apply when an issue is exempt from being marked stale. Separate multiple labels with commas (eg. "label1,label2")'
28-
stale-pr-label:
29-
description: 'The label to apply when a pull request is stale.'
30-
default: 'Stale'
31-
exempt-pr-labels:
32-
description: 'The labels to apply when a pull request is exempt from being marked stale. Separate multiple labels with commas (eg. "label1,label2")'
33-
ancient-issue-message:
34-
description: 'The message to post when an issue is very old.'
35-
ancient-pr-message:
36-
description: 'The message to post when a pr is very old.'
37-
days-before-ancient:
38-
description: 'The number of days old an issue can be before marking it ancient.'
39-
default: 360
40-
response-requested-label:
41-
description: 'The label that gets applied when a response is requested.'
42-
closed-for-staleness-label:
43-
description: 'The label that gets applied when an issue is closed for staleness.'
448
minimum-upvotes-to-exempt:
45-
description: 'The minimum number of "upvotes" that an issue needs to have before not marking as ancient.'
46-
loglevel:
47-
description: 'Set to DEBUG to enable debug logging'
9+
description: 'The minimum number of "upvotes" that an issue needs to have before never closing it.'
10+
default: 0
4811
dry-run:
4912
description: 'Set to true to not perform repository changes'
13+
default: false
14+
15+
#name: "'Stale Issue Cleanup' Action for GitHub Actions"
16+
#description: 'Close issues and pull requests with no recent activity'
17+
#branding:
18+
# icon: 'cloud'
19+
# color: 'orange'
20+
#inputs:
21+
# repo-token:
22+
# description: 'Token for the repository. Can be passed in using {{ secrets.GITHUB_TOKEN }}'
23+
# required: true
24+
# issue-types:
25+
# description: 'Issue types to process ("issues", "pull_requests", or "issues,pull_requests")'
26+
# default: 'issues,pull_requests'
27+
# stale-issue-message:
28+
# description: 'The message to post on the issue when tagging it. If none provided, will not mark issues stale.'
29+
# stale-pr-message:
30+
# description: 'The message to post on the pr when tagging it. If none provided, will not mark pull requests stale.'
31+
# days-before-stale:
32+
# description: 'The number of days old an issue can be before marking it stale.'
33+
# default: 60
34+
# days-before-close:
35+
# description: 'The number of days to wait to close an issue or pull request after it being marked stale.'
36+
# default: 7
37+
# stale-issue-label:
38+
# description: 'The label to apply when an issue is stale.'
39+
# default: 'Stale'
40+
# exempt-issue-labels:
41+
# description: 'The labels to apply when an issue is exempt from being marked stale. Separate multiple labels with commas (eg. "label1,label2")'
42+
# stale-pr-label:
43+
# description: 'The label to apply when a pull request is stale.'
44+
# default: 'Stale'
45+
# exempt-pr-labels:
46+
# description: 'The labels to apply when a pull request is exempt from being marked stale. Separate multiple labels with commas (eg. "label1,label2")'
47+
# ancient-issue-message:
48+
# description: 'The message to post when an issue is very old.'
49+
# ancient-pr-message:
50+
# description: 'The message to post when a pr is very old.'
51+
# days-before-ancient:
52+
# description: 'The number of days old an issue can be before marking it ancient.'
53+
# default: 360
54+
# response-requested-label:
55+
# description: 'The label that gets applied when a response is requested.'
56+
# closed-for-staleness-label:
57+
# description: 'The label that gets applied when an issue is closed for staleness.'
58+
# minimum-upvotes-to-exempt:
59+
# description: 'The minimum number of "upvotes" that an issue needs to have before not marking as ancient.'
60+
# loglevel:
61+
# description: 'Set to DEBUG to enable debug logging'
62+
# dry-run:
63+
# description: 'Set to true to not perform repository changes'
5064

5165
runs:
52-
using: 'docker'
53-
image: 'Dockerfile'
66+
using: 'node16'
67+
main: 'dist/index.js'
5468
env:
55-
REPO_TOKEN: ${{ inputs.repo-token }}
56-
ISSUE_TYPES: ${{ inputs.issue-types }}
57-
ANCIENT_ISSUE_MESSAGE: ${{ inputs.ancient-issue-message }}
58-
ANCIENT_PR_MESSAGE: ${{ inputs.ancient-pr-message }}
59-
STALE_ISSUE_MESSAGE: ${{ inputs.stale-issue-message }}
60-
STALE_PR_MESSAGE: ${{ inputs.stale-pr-message }}
61-
DAYS_BEFORE_STALE: ${{ inputs.days-before-stale }}
62-
DAYS_BEFORE_CLOSE: ${{ inputs.days-before-close }}
63-
DAYS_BEFORE_ANCIENT: ${{ inputs.days-before-ancient }}
64-
STALE_ISSUE_LABEL: ${{ inputs.stale-issue-label }}
65-
EXEMPT_ISSUE_LABELS: ${{ inputs.exempt-issue-labels }}
66-
STALE_PR_LABEL: ${{ inputs.stale-pr-label }}
67-
EXEMPT_PR_LABELS: ${{ inputs.exempt-pr-labels }}
68-
RESPONSE_REQUESTED_LABEL: ${{ inputs.response-requested-label }}
69-
CFS_LABEL: ${{ inputs.closed-for-staleness-label }}
69+
REPO_TOKEN: ${{ github.token }}
70+
# ISSUE_TYPES: ${{ inputs.issue-types }}
71+
# ANCIENT_ISSUE_MESSAGE: ${{ inputs.ancient-issue-message }}
72+
# ANCIENT_PR_MESSAGE: ${{ inputs.ancient-pr-message }}
73+
# STALE_ISSUE_MESSAGE: ${{ inputs.stale-issue-message }}
74+
# STALE_PR_MESSAGE: ${{ inputs.stale-pr-message }}
75+
# DAYS_BEFORE_STALE: ${{ inputs.days-before-stale }}
76+
# DAYS_BEFORE_CLOSE: ${{ inputs.days-before-close }}
77+
# DAYS_BEFORE_ANCIENT: ${{ inputs.days-before-ancient }}
78+
# STALE_ISSUE_LABEL: ${{ inputs.stale-issue-label }}
79+
# EXEMPT_ISSUE_LABELS: ${{ inputs.exempt-issue-labels }}
80+
# STALE_PR_LABEL: ${{ inputs.stale-pr-label }}
81+
# EXEMPT_PR_LABELS: ${{ inputs.exempt-pr-labels }}
82+
# RESPONSE_REQUESTED_LABEL: ${{ inputs.response-requested-label }}
83+
# CFS_LABEL: ${{ inputs.closed-for-staleness-label }}
7084
MINIMUM_UPVOTES_TO_EXEMPT: ${{ inputs.minimum-upvotes-to-exempt }}
71-
LOGLEVEL: ${{ inputs.loglevel }}
85+
# LOGLEVEL: ${{ inputs.loglevel }}
7286
DRYRUN: ${{ inputs.dry-run }}

0 commit comments

Comments
 (0)