gianm commented on code in PR #19089:
URL: https://github.com/apache/druid/pull/19089#discussion_r2912629075


##########
.github/workflows/pr-checks.yml:
##########
@@ -0,0 +1,101 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Adapted from 
https://github.com/lance-format/lance/blob/main/.github/workflows/pr-title.yml
+
+name: PR Checks
+
+on:
+  # This needs to be a pull_request_target event to allow the workflow to
+  # modify labels on the PR.
+  pull_request_target:
+    types: [opened, edited, synchronize, reopened]
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event.pull_request.number || 
github.ref }}
+  cancel-in-progress: true
+
+jobs:
+  labeler:
+    permissions:
+      pull-requests: write
+    name: Label PR
+    runs-on: ubuntu-latest
+    steps:
+      - uses: srvaroa/labeler@master
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+        with:
+          fail_on_error: true
+  commitlint:
+    permissions:
+      pull-requests: write
+    name: Verify PR title / description conforms to semantic-release
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/setup-node@v4
+        with:
+          node-version: "20"
+      # These rules are disabled because Github will always ensure there
+      # is a blank line between the title and the body and Github will
+      # word wrap the description field to ensure a reasonable max line
+      # length.
+      - run: npm install @commitlint/config-conventional
+      - run: >
+          echo 'module.exports = {
+            "rules": {
+              "body-max-line-length": [0, "always", Infinity],
+              "footer-max-line-length": [0, "always", Infinity],
+              "body-leading-blank": [0, "always"]
+            }
+          }' > .commitlintrc.js
+      - run: npx commitlint --extends @commitlint/config-conventional 
--verbose <<< $COMMIT_MSG

Review Comment:
   Docs (https://github.com/srvaroa/labeler) suggest the builtin list is the 
following. I think we should customize the list. In addition to these, it's 
also useful to have `backport`, `release` (release-related changes like version 
bumps), `revert`, and `dev` (changes geared towards developers; this PR would 
be categorized as `dev` if we adopted it).
   
   If we're allowing bike shedding, I prefer `minor` to `chore` for small 
non-user-visible changes like correcting comments. `chore` has some negative 
sound to it, whereas `minor` to me sounds more neutral.
   
   ```
   [
     'build',
     'chore',
     'ci',
     'docs',
     'feat',
     'fix',
     'perf',
     'refactor',
     'revert',
     'style',
     'test'
   ]
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to