Skip to content

Test generating Set<>-fields when uniqueItems: true #31

Test generating Set<>-fields when uniqueItems: true

Test generating Set<>-fields when uniqueItems: true #31

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(', ')}`);
}
}
}