{"id":22369536,"url":"https://github.com/20minutes/serverless-github-check","last_synced_at":"2025-07-30T19:31:07.184Z","repository":{"id":39640449,"uuid":"157223875","full_name":"20minutes/serverless-github-check","owner":"20minutes","description":":zap: A Serverless project to validate GitHub PRs against some specifications","archived":false,"fork":false,"pushed_at":"2024-10-24T00:43:28.000Z","size":7349,"stargazers_count":13,"open_issues_count":0,"forks_count":0,"subscribers_count":15,"default_branch":"master","last_synced_at":"2024-10-24T04:44:56.895Z","etag":null,"topics":["20minutes","github","github-webhooks","noservernovember","serverless","serverless-framework"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/20minutes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-12T14:12:40.000Z","updated_at":"2024-10-24T00:43:31.000Z","dependencies_parsed_at":"2023-09-27T05:23:21.318Z","dependency_job_id":"e742596e-88db-43c8-8321-8677f240a25f","html_url":"https://github.com/20minutes/serverless-github-check","commit_stats":null,"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/20minutes%2Fserverless-github-check","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/20minutes%2Fserverless-github-check/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/20minutes%2Fserverless-github-check/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/20minutes%2Fserverless-github-check/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/20minutes","download_url":"https://codeload.github.com/20minutes/serverless-github-check/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228177519,"owners_count":17880869,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["20minutes","github","github-webhooks","noservernovember","serverless","serverless-framework"],"created_at":"2024-12-04T19:26:20.410Z","updated_at":"2025-07-30T19:31:07.161Z","avatar_url":"https://github.com/20minutes.png","language":"JavaScript","readme":"# Serverless GitHub Check\n\n[![Build Status](https://github.com/20minutes/serverless-github-check/actions/workflows/tests.yml/badge.svg)](https://github.com/20minutes/serverless-github-check/actions/workflows/tests.yml)\n\nApply some simple checks on each PR.\n\n\u003cpicture\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://user-images.githubusercontent.com/62333/198560616-abd7f44b-87b9-41f4-a32b-47865f008ec7.png\"\u003e\n  \u003cimg width=\"752\" alt=\"example\" src=\"https://user-images.githubusercontent.com/62333/198560107-4818722b-6619-47b9-b2da-124d15c85dc8.png\"\u003e\n\u003c/picture\u003e\n\n## Use Cases\n\nWe have 4 functions available:\n\n- **specification**: It validates GitHub Pull Requests against some specifications:\n    - `body` should be at least 8 characters long\n    - `title` should be at least 8 characters long\n- **label**: It checks if there is a blocking label in the GitHub Pull Request\n    - if one blocking label (default: `Work In Progress`, `Waiting For Change`, `Waiting For Travis`) is found, PR is blocked\n    - if no labels are defined in the PR, PR is blocked\n    - if no blocking labels are defined, PR is validated\n- **fixup**: It checks if there is some `fixup!` commits in the PR history\n    - if at least one fixup commit are found, PR is blocked\n    - if no fixup commits are found, PR is validated\n- **autoMerge**: It merges PR from @dependabot when the update it for a patch or a minor version\n    - the repo must have the _auto merge_ option enabled\n\n## Prerequisites\n\n- Node.js 22\n- OSS Serverless (`npm install -g osls`)\n- An AWS account\n- Defined [provider credentials](https://serverless.com/framework/docs/providers/aws/guide/credentials/)\n\n## Setup\n\n### Deploy the code\n\n- Get a [new personal access token](https://github.com/settings/tokens/new) on GitHub\n- Set it in [AWS Parameter Store](https://eu-west-1.console.aws.amazon.com/systems-manager/parameters/create?region=eu-west-1) as a `SecureString` with name `GITHUB_TOKEN`\n- Deploy the service using: `serverless deploy`\n\nBy default\n\n- it'll use the AWS profile `default`, but you can use your own using (be sure it's defined in your `~/.aws/credentials`): `serverless deploy --aws-profile myprofile`\n- it'll be deployed to the AWS region `eu-west-1` but you can change it using: `serverless deploy --region us-east-1`\n\n### Setup GitHub webhook\n\nConfigure the webhook in [the GitHub repository settings](https://developer.github.com/webhooks/creating/#setting-up-a-webhook).\n\n- In the Payload URL, enter the URL you received after deploying. It would be something like `https://\u003cyour_url\u003e.amazonaws.com/dev/webhook`.\n- Choose the \"application/json\" in Content type.\n- In the types of events to trigger the webhook, select \"Let me select individual events\", then select at least `Pull Requests`.\n\n### Some options\n\nYou can update some options from the `serverless.yml` file:\n\n- `NAMESPACE`: change the namespace used in the PR check (displayed at the bottom of each PR)\n- `CHECK_BODY_LENGTH`: change the minimun length of the body of the PR\n- `CHECK_TITLE_LENGTH`: change the minimun length of the title of the PR\n- `BLOCK_LABELS`: define which label will block a PR (coma separated strings)\n\n## Info\n\nThis little project is part of the [#NoServerNovember challenge](https://serverless.com/blog/no-server-november-challenge/).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F20minutes%2Fserverless-github-check","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F20minutes%2Fserverless-github-check","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F20minutes%2Fserverless-github-check/lists"}