Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/scottlogic/gitlab-cla-bot
https://github.com/scottlogic/gitlab-cla-bot
Last synced: about 7 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/scottlogic/gitlab-cla-bot
- Owner: ScottLogic
- Created: 2020-01-16T08:35:51.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-24T01:31:33.000Z (almost 2 years ago)
- Last Synced: 2024-05-18T03:48:20.375Z (6 months ago)
- Language: JavaScript
- Size: 1.11 MB
- Stars: 1
- Watchers: 25
- Forks: 1
- Open Issues: 33
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gitlab-cla-bot
Pre-requisites:
- AWS account
- gitlab repo & access to itSet-up:
- Get a personal access token for the repo you wish to run against
- Set the variable `gitlabToken` in index.js to your gitlab personal access token
- install and run the AWS sdk locally to create a node_modules in srcTo deploy manually
- zip the contents of src
- create a lambda in the AWS console
- upload your zip file as lambda content
- create an open API gateway, set it to receive POST requests, and note down the endpoint givenTo deploy using serverless:
- install serverless (available via npm and choco)
- set up an appropriate IAM user (see below) in your AWS account and obtain a key and secret
- set up AWS credentials locally with
`serverless config credentials --provider aws --key AKIAIOSFODNN7EXAMPLE --secret wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY`
See the guide at https://serverless.com/framework/docs/providers/aws/guide/credentials/ for more detail and alternative ways to do this
- Run serverless deploy and note down the endpoint given
- Logs can be found in AWS Lambda -> MonitoringTo hook into Gitlab:
- Go to Settings->Integrations in Gitlab
- Add a new webhook triggered by `Comments` and `Merge request events`. Hook URL should be the endpoint you've noted down. Untick security options
- Click Test->`Note events` or `Merge requests events`
- Result should appear at the top of the page: ![Gitlab success message](./gitlab-success-message.PNG)
- Add a `.clabot` file in the root of the project with a whitelist of the gitlab usernames that are cla-signed:
```
{
"contributors": [""]
}
```
- Create a merge request or make a comment including the text "@gitlab-cla-bot check" on a merge request and the bot should respond.IAM user permissions required (see https://github.com/serverless/serverless/issues/1674):
- "cloudformation:CreateStack",
- "cloudformation:DescribeStacks",
- "cloudformation:DescribeStackResources",
- "cloudformation:UpdateStack",
- "cloudformation:ListStacks",
- "iam:GetRole",
- "lambda:UpdateFunctionCode",
- "lambda:UpdateFunctionConfig",
- "lambda:GetFunctionConfiguration",
- "lambda:AddPermission",
- "s3:DeleteObject",
- "s3:GetObject",
- "s3:ListBucket",
- "s3:PutObject"