Skip to content

Commit

Permalink
fix: update readme with clearer options
Browse files Browse the repository at this point in the history
Closes #13
  • Loading branch information
kellertk committed Apr 23, 2020
1 parent 07deb24 commit 91f6b86
Showing 1 changed file with 54 additions and 29 deletions.
83 changes: 54 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,76 @@
# "Stale Issue Cleanup" Action for GitHub Actions

This GitHub action warns and then closes issues and PRs without activity
after a specified amount of time. It improves upon GitHub's original
`stale` action by allowing the action to run only on issues that contain
a specified label, and removing affecting labels once the issue sees new
activity.
after a specified amount of time. It improves upon [GitHub's original
stale action](/~https://github.com/actions/stale) by allowing the action
to run only on issues that contain a specified label, and removing labels
once the issue sees new activity.

## Building and testing

Install dependencies
```bash
$ yarn install
```

Run unit tests
```bash
$ yarn test
```

### Local Integ Testing with Docker

This action is using Docker, so you can test it locally in dry run mode if you
wish.

```bash
$ docker build -t stale-issue-cleanup .
$ docker run --label stale-issue-cleanup --env-file test/local-docker.env stale-issue-cleanup
```

Check out [local-docker.env](./test/local-docker.env) to configure your local
testing options. Once you're satisfied that it's working the way you expect,
you can create a workflow file and implement this as an action on your repo.


## Usage

Add the following step to your workflow.
You need to add a workflow file into your repository under
[.github/workflows](./.github/workflows), just like any other Github Action.
This workflow file [follows the standard workflow syntax for Github Actions.](https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions).

A sample workflow file for you to use as a drop-in is in [sample_workflow.yml](./sample_workflow.yml).

Here's an abbreviated example with just the step for this action:

```yaml
name: "Close stale issues"
uses: aws-actions/stale-issue-cleanup@v2
with:
steps:
- uses: aws-actions/stale-issue-cleanup@v2
with:
# Messages this action will apply to issues
stale-issue-message: Stale issue message
stale-pr-message: Stale issue message
ancient-issue-message: Stale issue message

# Labels this action will apply to issues
stale-issue-label: closing-soon
exempt-issue-label: awaiting-approval
stale-pr-label: no-pr-activity
exempt-pr-label: awaiting-approval
response-requested-label: response-requested
closed-for-staleness-label: closed-for-staleness

days-before-stale: 4,
days-before-close: 7,
# Issue timing and upvote counting
days-before-stale: 4
days-before-close: 7
days-before-ancient: 365
minimum-upvotes-to-exempt: 10

# Testing/debugging options
loglevel: DEBUG
dry-run: true

# Leave this alone, or set to a PAT for the action to use
repo-token: ${{ secrets.GITHUB_TOKEN }}
```
Expand All @@ -35,25 +79,6 @@ explicit tag, or commit SHA:
`uses: aws-actions/stale-issue-cleanup@v2`

Check out [sample_workflow.yml](./sample_workflow.yml) for a complete
example.

## Local Testing

This action is using Docker, so you can test it locally in dry run mode if you
wish.

First, clone this repo, then:

```bash
docker build -t stale-issue-cleanup .
docker run --label stale-issue-cleanup --env-file test/local-docker.env stale-issue-cleanup
```

Check out [local-docker.env](./test/local-docker.env) to configure your local
testing options. Once you're satisfied that it's working the way you expect,
you can create a workflow file and implement this as an action on your repo.

## License Summary

This code is made available under the Apache-2.0 license.
Expand Down

0 comments on commit 91f6b86

Please sign in to comment.