Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
luanpotter committed May 15, 2021
1 parent 8b7e6b5 commit 08ee3e7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/changes-requested.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: luanpotter/changes-requested@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: luanpotter/changes-requested@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
```
## What are updates?
Expand Down
9 changes: 6 additions & 3 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@ name: 'Changes Requested'
description: 'A GitHub action to unobtrusively close issues marked with a label that had no updates'
icon: alert-triangle
inputs:
daysUntilClose:
github-token:
description: Your GITHUB_TOKEN variable.
required: true
days-until-close:
description: How many days after adding the label should the issue be closed if there are no updates.
required: true
default: 5
triggerLabel:
trigger-label:
description: The label that you manually add to issues to start the countdown.
required: true
default: 'changes-requested'
closingComment:
closing-comment:
description: 'The message added by the bot on the closing comment on the issue.'
required: true
default: 'This issue was closed by the changes-requested bot due to inactivity.'
Expand Down
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import * as github from '@actions/github';

async function run(): Promise<void> {
try {
const daysUntilClose = parseInt(core.getInput('daysUntilClose'));
const triggerLabel = core.getInput('triggerLabel');
const closingComment = core.getInput('closingComment');

const token = core.getInput('github-token', {required: true});
const daysUntilClose = parseInt(core.getInput('days-until-close', {required: true}));
const triggerLabel = core.getInput('trigger-label', {required: true});
const closingComment = core.getInput('closing-comment', {required: true});

const client = github.getOctokit(token);
const issues = await client.rest.issues.list();
core.info(`Found ${issues.data.length} issues ${daysUntilClose} ${triggerLabel} ${closingComment}.`);
Expand Down

0 comments on commit 08ee3e7

Please sign in to comment.