Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close "Needs Info" issues when inactive for long period of time #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aaronang
Copy link
Member

@aaronang aaronang commented Mar 18, 2017

Babelbot will wait for 30 days until closing the issue after an issue has been labeled "Needs Info". The setup is kind of troublesome though.

First, we have to generate a signature.

The hash has to be computed manually by using GITHUB_SECRET in Node CLI:

var crypto = require('crypto')

var body = {
  "action": "closing",
  "repository": {
    "owner": {
      "login": "babel"
    },
    "name": "babel"
  }
}

crypto
  .createHmac('sha1', GITHUB_SECRET)
  .update(new Buffer(JSON.stringify(body), 'utf-8'))
  .digest('hex');

// Output: HASH

Then, create a JSON object by replacing <HASH> with the generated hash:

{
  "signature": "sha1=<HASH>",
  "data": {
    "action": "closing",
    "repository": {
      "owner": {
        "login": "babel"
      },
      "name": "babel"
    }
  },
  "type": "issues"
}

This JSON object can then be send via a CloudWatch rule according to a schedule.

Fixes #20.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant