Test generating Set<>
-fields when uniqueItems: true
#29
Workflow file for this run
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
name: Github PR Audit | |
on: | |
pull_request: | |
types: | |
- opened | |
- edited | |
- labeled | |
- unlabeled | |
issue_comment: | |
types: | |
- created | |
- edited | |
- deleted | |
jobs: | |
Audit-Pull-Request: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/github-script@v6 | |
with: | |
script: | | |
const categoriesRequiringSemanticVersion = ['feat', 'bug']; | |
const requiredCategories = ['feat', 'bug', 'doc', 'test', 'dependencies', 'meta']; | |
const semanticVersions = ['MAJOR', 'MINOR', 'PATCH']; | |
if (context.payload.pull_request) { | |
const labels = context.payload.pull_request.labels; | |
if (labels.filter(label => requiredCategories.includes(label.name)).length == 0) { | |
throw new Error(`Pull Request requires one of the following labels: ${requiredCategories.join(', ')}`); | |
} | |
if (labels.filter(label => categoriesRequiringSemanticVersion.includes(label.name)).length > 0) { | |
if (labels.filter(label => semanticVersions.includes(label.name)).length == 0) { | |
throw new Error(`Pull Request requires a 'Semantic version'-label for the following labels: ${categoriesRequiringSemanticVersion.join(', ')}`); | |
} | |
} | |
} | |