Skip to content

Commit

Permalink
Add CI to ensure PR does not contains merge commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
sbernard31 committed Jun 17, 2022
1 parent b741a20 commit f0fc3c9
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
25 changes: 25 additions & 0 deletions .github/actions/no_merge/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: "Check No Merge commit"
description: "Check PR does not contains any merge commit"

runs:
using: "composite"
steps:

- name: Check For Merge Commit
id: no_merge
uses: voxie-actions/no-merge-commits@v1.0.0

- name: Add comment
if: failure()
uses: marocchino/sticky-pull-request-comment@v2
with:
header: Merge Commit Detected
message: |
:x: **PR should not contain "Merge Commit"**, so please use `git rebase` instead.
- name: Delete comment
if: success()
uses: marocchino/sticky-pull-request-comment@v2
with:
header: Merge Commit Detected
delete: true
6 changes: 5 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,16 @@ jobs:
distribution: 'adopt'
cache: maven

- name: Check No Merge Commit
uses: ./.github/actions/no_merge

- name: Build
if: always()
id: build
uses: ./.github/actions/build

- name: Generate Javadoc
if: ${{ steps.build.conclusion == 'success' }}
if: ${{ always() && steps.build.conclusion == 'success' }}
uses: ./.github/actions/javadoc

- name: Unit Tests
Expand Down

0 comments on commit f0fc3c9

Please sign in to comment.