aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/commit-validation.yml
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2023-12-26 22:49:50 -0800
committerJohn MacFarlane <[email protected]>2023-12-26 22:49:50 -0800
commit0ba8af939c7bf95882ea8c2e877f20fd533202fc (patch)
treee578f725d89260e1b0edc842f04196b9c062a104 /.github/workflows/commit-validation.yml
parentb9b8343645f0ba454de83268ffc1d67b3e8aa034 (diff)
commit validation CI: work with regular push as well as pr.
Diffstat (limited to '.github/workflows/commit-validation.yml')
-rw-r--r--.github/workflows/commit-validation.yml9
1 files changed, 7 insertions, 2 deletions
diff --git a/.github/workflows/commit-validation.yml b/.github/workflows/commit-validation.yml
index 45eb55214..a7ba07a73 100644
--- a/.github/workflows/commit-validation.yml
+++ b/.github/workflows/commit-validation.yml
@@ -1,5 +1,5 @@
name: commit-validation
-on: [ pull_request ]
+on: [ push, pull_request ]
permissions:
contents: read
@@ -16,7 +16,12 @@ jobs:
result-encoding: json
script: |
var longlines = 0;
- const commits = ${{ toJSON(github.event.pull_request.commits) }}
+ const commits = [];
+ if (github.event.pull_request) {
+ commits = ${{ toJSON(github.event.pull_request.commits) }};
+ } else {
+ commits = ${{ toJSON(github.event.commits) }};
+ }
for (const commit of commits) {
for (const line of commit.message.split('\n')) {
if (line.length > 78) {