Skip to content

Commit

Permalink
chore: support library names as conventional commit subjects in PRs (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Chriscbr authored Mar 27, 2024
1 parent 4707bbc commit c0281de
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/pull-request-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,26 @@ jobs:
chore
rfc
revert
bedrock
budget
checks
cognito
containers
dynamodb
eventbridge
fifoqueue
github
jwt
lock
messagefanout
ngrok
openai
postgres
redis
sagemaker
simtools
vite
websockets
subjectPattern: ^[^A-Z][^:]+[^.]$
subjectPatternError: Subject must start with a lowercase, should not include ':'
and should not end with a period
Expand Down
2 changes: 1 addition & 1 deletion generate-workflows.main.w
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ readme.update(libs.copy());
new stale.StaleWorkflow(workflowdir);
new mergify.MergifyWorkflow(libs.copy());
new prdiff.PullRequestDiffWorkflow(workflowdir);
new prlint.PullRequestLintWorkflow(workflowdir);
new prlint.PullRequestLintWorkflow(workflowdir, libs.copy());

let skipCanaryTests = [
"containers" // https://github.com/winglang/wing/issues/5716
Expand Down
14 changes: 12 additions & 2 deletions pr-lint.w
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
bring fs;

pub class PullRequestLintWorkflow {
new(workflowdir: str) {
new(workflowdir: str, libs: Array<str>) {
let var types = MutArray<str>[
"feat",
"fix",
"docs",
"chore",
"rfc",
"revert",
];
types = types.concat(libs.copyMut());

fs.writeYaml("{workflowdir}/pull-request-lint.yaml", {
name: "Pull Request Lint",
on: {
Expand All @@ -21,7 +31,7 @@ pub class PullRequestLintWorkflow {
"GITHUB_TOKEN": "$\{\{ secrets.GITHUB_TOKEN \}\}"
},
"with": {
"types": "feat\nfix\ndocs\nchore\nrfc\nrevert",
"types": types.join("\n"),
"subjectPattern": "^[^A-Z][^:]+[^.]$",
"subjectPatternError": "Subject must start with a lowercase, should not include ':' and should not end with a period",
"requireScope": false
Expand Down

0 comments on commit c0281de

Please sign in to comment.