merge development to release v2 #3364
This file contains hidden or 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
| name: "PR Validation" | |
| on: | |
| pull_request_target: | |
| types: | |
| - opened | |
| - edited | |
| - synchronize | |
| - reopened | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| validate: | |
| name: Validate Pull Request | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Validate PR Title | |
| uses: amannn/action-semantic-pull-request@v5 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.PR_GITHUB_TOKEN }} | |
| with: | |
| types: | | |
| feat | |
| fix | |
| docs | |
| style | |
| refactor | |
| test | |
| build | |
| ci | |
| chore | |
| revert | |
| l10n | |
| taxonomy | |
| requireScope: false | |
| subjectPattern: ^(?![A-Z]).+$ | |
| subjectPatternError: | | |
| The subject must start with a lowercase letter. | |
| validateSingleCommit: true | |
| validateSingleCommitMatchesPrTitle: true | |
| - name: Validate PR Size | |
| uses: actions/github-script@v6 | |
| with: | |
| script: | | |
| const MAX_FILES = 50; | |
| const files = await github.rest.pulls.listFiles({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| pull_number: context.issue.number | |
| }); | |
| if (files.data.length > MAX_FILES) { | |
| core.setFailed(`PR contains ${files.data.length} files. Maximum allowed is ${MAX_FILES}.`); | |
| } |