-
Notifications
You must be signed in to change notification settings - Fork 2
33 lines (33 loc) · 1.27 KB
/
pull-request-lint.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: pull-request-lint
on:
pull_request_target:
types:
- labeled
- opened
- synchronize
- reopened
- ready_for_review
- edited
permissions: read-all
jobs:
contributorStatement:
if: ${{ ! (github.event.pull_request.user.login == 'amazon-auto' || github.event.pull_request.user.login =='dependabot[bot]') }}
name: Require Contributor Statement
runs-on: ubuntu-latest
permissions:
pull-requests: read
env:
PR_BODY: ${{ github.event.pull_request.body }}
EXPECTED: By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the project license.
HELP: Contributor statement missing from PR description. Please include the following text in the PR description
steps:
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
with:
script: |-
const actual = process.env.PR_BODY.replace(/\r?\n/g, "\n");
const expected = process.env.EXPECTED.replace(/\r?\n/g, "\n");
if (!actual.includes(expected)) {
console.log("%j", actual);
console.log("%j", expected);
core.setFailed(`${process.env.HELP}: ${expected}`);
}