refactor(cli): require approval is a part of the CliIoHost #1167
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". | |
name: pull-request-lint | |
on: | |
pull_request_target: | |
types: | |
- labeled | |
- opened | |
- synchronize | |
- reopened | |
- ready_for_review | |
- edited | |
merge_group: {} | |
jobs: | |
validate: | |
name: Validate PR title | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: write | |
if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') | |
steps: | |
- uses: amannn/action-semantic-pull-request@v5.4.0 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
types: |- | |
feat | |
fix | |
chore | |
refactor | |
test | |
docs | |
revert | |
requireScope: false | |
contributorStatement: | |
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 my contribution is made under the terms of the Apache-2.0 license | |
HELP: Contributor statement missing from PR description. Please include the following text in the PR description | |
if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && !(github.event.pull_request.user.login == 'aws-cdk-automation' || github.event.pull_request.user.login == 'dependabot[bot]') | |
steps: | |
- uses: actions/github-script@v6 | |
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}`); | |
} |