Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

github: Reject merge commits in pull requests in ci-lint workflow #107

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
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
12 changes: 12 additions & 0 deletions .github/workflows/ci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ on:
- master
- stable/*

# Limit GITHUB_TOKEN's permissions to:
permissions:
# Read access to pull requests.
pull-requests: read

jobs:
lint:
# NOTE: This name appears in GitHub's Checks API.
Expand All @@ -40,3 +45,10 @@ jobs:
- name: Lint git commits
run: |
make lint-git
- name: Reject merge commits in pull requests
uses: Morishiri/[email protected]
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
Comment on lines +49 to +51
Copy link
Member

Choose a reason for hiding this comment

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

I don't like their error message "1 commit(s) cannot be merged", but it isn't configurable :(

# Run this step even if the previous one fails so that all linting
# errors can be seen at once. BLA
Copy link
Member

Choose a reason for hiding this comment

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

BLA? :D

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, that's in the XXX commit 😀

if: always() && github.event_name == 'pull_request'