commitlint-github-action
commitlint-github-action copied to clipboard
Run the action with GitHub Action's `merge_group` event
TL;DR:
I'm using the merge_group
event on GitHub, to check against the squashed commit that is about to be merged, and using merge queue only for this purpose, to prevent merge commits to not be commitlint.
For some reason, the action keeps on succeeding although it should fail.
An important note:
When I run this action in the pull_request
event or push
event it works correctly and fails the workflow!
so there's only an issue with the merge_group
event.
See this repo: https://github.com/yossi-test-org/test-merge-queue with this action: https://github.com/yossi-test-org/test-merge-queue/actions/workflows/commitlint.yml and more specifically this action run: https://github.com/yossi-test-org/test-merge-queue/actions/runs/7897818307/job/21554034430 which ran on this commit: https://github.com/yossi-test-org/test-merge-queue/commit/2f49ddbde246e380780396787ae33e9842e198e5
Attached an image to summarize all (see the "Show commit message" step that makes sure what commitlint runs against):
name: Lint merge commit name
on:
pull_request:
merge_group:
types: [checks_requested]
jobs:
lint-commit-name:
if: ${{ github.event_name == 'merge_group' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: wagoid/commitlint-github-action@v5
It's a required action, so it should fail the merge queue and to not merge this PR: