Skip to content

Commit

Permalink
Merge pull request #54 from seqeralabs/fail-build-on-merge-conflict-m…
Browse files Browse the repository at this point in the history
…arkers

Prevent Git conflict markers from getting published
  • Loading branch information
jason-seqera authored May 14, 2024
2 parents 13514c6 + 5438053 commit 168e7d1
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/no-conflict-markers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# https://stackoverflow.com/a/76322606
name: No unresolved conflicts
on:
pull_request:
branches: [ master ]
jobs:
detect-unresolved-conflicts:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: List files with merge conflict markers
run: git --no-pager grep "<<<<<<<" ":(exclude).github/" || true
- name: Fail or succeed job if any files with merge conflict markers have been checked in
# Find lines containing "<<<<<<<", then count the number of lines.
# 0 matching lines results in exit code 0, i.e. success.
run: exit $(git grep "<<<<<<<" ":(exclude).github/" | wc --lines)

0 comments on commit 168e7d1

Please sign in to comment.