π Issue Creator
WIP
βΆοΈ 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
- Move to Slack API: Applications | Slack and click to "Create New App".
- Input your application name and select your slack workspace for running the application.
- Select "Slash Commands" of the "Add features and functionality" section.
- Press the "Create New Command".
- Input Command, Request URL, Short Description and Usage Hint (Please refer to the list below).
- Press the "Save" button.
- Move to Slack API: Applications | Slack and select the application you created.
- 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