Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6f68505

Browse files
ci: prevent merge-requests in a PR
Have the CI prevent merge-requests being part of a PR
1 parent48726fd commit6f68505

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

‎.github/workflows/lint.yml‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,14 @@ jobs:
4141
run:tox -e isort -- --check
4242
-name:Run pylint Python code static checker (https://github.com/PyCQA/pylint)
4343
run:tox -e pylint
44+
-name:Ensure no merge-commits in the Pull Request (PR)
45+
if:github.event_name == 'pull_request'
46+
run:|
47+
HEAD_SHA="${{ github.event.pull_request.head.sha }}"
48+
echo "GITHUB_BASE_REF: ${GITHUB_BASE_REF}"
49+
echo "HEAD_SHA: ${HEAD_SHA}"
50+
MERGE_COMMITS=$(git rev-list --merges origin/${GITHUB_BASE_REF}..${HEAD_SHA})
51+
if [[ -n "${MERGE_COMMITS}" ]]; then
52+
echo "ERROR: The Pull Request (PR) contains a 'merge commit': ${MERGE_COMMITS}"
53+
exit 1
54+
fi

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp