aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/commit-validation.yml
diff options
context:
space:
mode:
authorEdwin Török <[email protected]>2023-12-27 17:36:22 +0000
committerJohn MacFarlane <[email protected]>2023-12-27 10:38:44 -0800
commit56df2f1c1773372c891b78ca50d3d267788afc11 (patch)
tree0a62b441a49aa34e92de835705a1bce992ff7199 /.github/workflows/commit-validation.yml
parent17af22044270da9a966590671bfd2e539636dd2a (diff)
ci(commit-validation): use git to walk commits
The PR event doesn't include the actual commits, just a count and a URL to fetch it. But we can checkout the entire git history, we don't have so many commits that we need to optimize this just yet. And then we might as well use `git` itself to walk the commit history. (Using the remote commits URL would be useful only if we'd want to do a shallow clone because we have too many commits) Signed-off-by: Edwin Török <[email protected]>
Diffstat (limited to '.github/workflows/commit-validation.yml')
-rw-r--r--.github/workflows/commit-validation.yml5
1 files changed, 2 insertions, 3 deletions
diff --git a/.github/workflows/commit-validation.yml b/.github/workflows/commit-validation.yml
index 252e7bfdd..46402f863 100644
--- a/.github/workflows/commit-validation.yml
+++ b/.github/workflows/commit-validation.yml
@@ -1,5 +1,5 @@
name: commit-validation
-on: [ push, pull_request ]
+on: [ push ]
permissions:
contents: read
@@ -16,8 +16,7 @@ jobs:
result-encoding: json
script: |
var longlines = 0;
- const pr = ${{ toJSON(github.event.pull_request) }};
- const commits = (pr && pr.commits) || ${{ toJSON(github.event.commits) }};
+ const commits = ${{ toJSON(github.event.commits) }};
for (const commit of commits) {
for (const line of commit.message.split('\n')) {
if (line.length > 78) {