Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 26 additions & 5 deletions .github/workflows/commit-message-validator.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,46 @@
name: Check if commit message body is not too short

on:
pull_request_target:
types: [opened, synchronize, edited, reopened]
pull_request:
Copy link
Contributor

@michburk michburk Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think running on both pull_request_target AND pull_request [open/sync/edit/reopen] means the workflow will run twice for each event, leaving two comments instead of one. Maybe we could just trigger on pull_request_target?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried, nothing helped.

types: [opened, synchronize, edited, reopened]

permissions: {}

jobs:
verify-body-length:
runs-on: ubuntu-latest
# set as non-voting for now.
continue-on-error: true

permissions:
contents: write
pull-requests: write
repository-projects: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Generate GitHub App Token
id: generate_token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ secrets.COMMENTER_APP_ID }}
private-key: ${{ secrets.COMMENTER_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: ci-framework

- name: Post comment
uses: actions/github-script@v7
with:
github-token: ${{ steps.generate_token.outputs.token }}
script: |
github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: 'my comment'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This adds an additional my comment comment from the bot on the pr

})

- name: Dump commit message to file
run: |
git fetch origin ${{ github.event.pull_request.head.sha }}
Expand All @@ -42,3 +62,4 @@ jobs:
issue-number: ${{ github.event.pull_request.number }}
body-path: ./result.log
reactions: confused
token: ${{ steps.generate_token.outputs.token }}
Loading