Skip to content

kotatsu360/gomashio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gomashio

inspired by https://github.com/kawahara/github2slack-lambda

Feature

  • convert GitHub mention to Slack mention
    • reviewers
    • assignees
    • issue / pr comment

Format

key value default required
account_map A object with key of github account and value of slack account - o
repository_map A object with key of github repository and value of slack channel - o
ignore_event_map A object with key of github event and value of array of action for github event -

sample

{
  "account_map": {
    "kotatsu360": "tmitsuno"
  },
  "repository\_map": {
    "^gomashio": "#gomashio-dev",
    ".*": "#general"
  },
  "ignore_event_map": {
    "issue_comment": [
      "edited"
    ]
  }
}

Architecture

GitHub -> Amazon API Gateway -> AWS Lambda -> Slack

Basic Usage

initialize api gateway / lambda function

  1. create Slack App
  2. set Scope
    • chat:write:bot, users:read
    • select_permissions
    • scopes
  3. install Slack App to your Slack Team
    • copy OAuth Access Token
    • install
    • copy
  4. set OAuth Access Token to SSM SecureString
  5. launch gomashio
    • set SSM Parameter Name to EncryptedTokenName
  6. Note ApiGatewayRestApi what is CFn Resource Name.
    • image
  7. set Endpoint URL to your GitHub Repository
    • https://<RestApi ID>.execute-api.<Region>.amazonaws.com/production/

update lambda function

  1. edit <gomashio root>/config/config.json
  2. zip -r index.zip <gomashio root>/
  3. upload lambda

Advanced Usage (gomashio with CI)

  1. Basic Usage > initialize api gateway / lambda function
  2. launch gomachio-ci
    • set FunctionStackName ( default: gomashio )
  3. Note S3BucketCodePipelineSource what is CFn Resource Name.
  4. create IAMUserCI Access Token
  5. set Access Token to CI
  6. set AWS_DEFAULT_REGION to CI
  7. set S3_BUCKET_CODE_PIPELINE_SOURCE to CI

update lambda function

  1. edit <gomashio root>/config/config.json
  2. merge or push master branch

Remove gomashio

  1. remove gomashio-ci-stack from CFn
  2. remove gomashio-stack from CFn
  3. remove gomashio-ci-role from IAM
    • <gomashio-ci-stack name>-IAMRoleCloudFormation-<Random string>

LICENSE

This software is released under the MIT License, see LICENSE