🚄 A Slack slash command for creating quickly a new issue on GitHub.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config
src
test
.eslintrc.yml
.gitignore
README.md
demo.gif
package-lock.json
package.json
template.yml

README.md

🚄 Issue Creator

WIP👷 A Slack slash command for creating quickly a new issue on GitHub.

▶️ Usage

Create a new issue on GitHub repository you set up when the "issue_creator" command executes on the Slack channel.

/issue_creator [issue title]

💾 Installation

Generate the GitHub Token

Move to New personal access token and create a token with repo scope.

Create the Slack slash command

  1. Move to Slack API: Applications | Slack and click to "Create New App".
  2. Input your application name and select your slack workspace for running the application.
  3. Select "Slash Commands" of the "Add features and functionality" section.
  4. Press the "Create New Command".
  5. Input Command, Request URL, Short Description and Usage Hint (Please refer to the list below).
  6. Press the "Save" button.
  7. Move to Slack API: Applications | Slack and select the application you created.
  8. Press the "Install App to Workspace" of the "Install your app to your workspace" section.

A description of configuration the Slack slash command

  • Command A name of the slash command.
  • Request URL A url of receive a POST request when the command is executed (you will change it later, so let's put in an any value).
  • Short Description A description of the slash command.
  • Usage Hint A usage example of parameters to be input after the command.

Install dependencies

$ npm install

Update the configuration file

Update the configuration file (config/default.json).

{
  "github": {
    "baseUrl": "", // option: An endpoint for GitHub API if using GitHub Enterprise (default: empty). e.g. https://githubenterprise.com/api/v3
    "repoOwner": "", // required: A repository owner name where a new issue is created.
    "repoName": "" // required: A repository name where a new issue is created.
  },
  "users": [ // required: A list of users who are allowed to execute slash command and assigned to the issue.
    {
      "slack": "john",
      "github": "john"
    },
    {
      "slack": "debra",
      "github": "debra"
    },
    {
      "slack": "alex",
      "github": "alex"
    },
    {
      "slack": "kentaro",
      "github": "kentaro"
    }
  ]
}

Create the deployment package

Create the Amazon S3 bucket to upload the deployment package.

$ aws s3 mb s3://<bucket-name> --region <region-name>

Create the deployment package using sam command.

NOTE: You can use aws cloudformation command instead of sam command.

$ sam package \
     --template-file template.yml \
     --output-template-file serverless-output.yml \
     --s3-bucket <s3-bucket-name>

Deploy

Deploy the application using sam command.

After the deployment is complete, move to the CloudFormation console and check the value of the RequestURL in the output section.

Please update the value of Request URL on Slack slash command configuration page.

NOTE: You can use aws cloudformation command instead of sam command.

$ sam deploy \
   --template-file serverless-output.yml \
   --stack-name <new-stack-name> \
   --parameter-overrides GitHubToken=<token> \ 
   --capabilities CAPABILITY_IAM

📝 License

MIT