From c26950d9c50af56c1969dd8595d7aa627354479b Mon Sep 17 00:00:00 2001 From: "John L. Villalovos" Date: Sat, 27 Jan 2024 18:58:16 -0800 Subject: [PATCH 1/2] ci: prevent merge-commits in a PR Have the CI prevent merge-commits being part of a PR --- .github/workflows/lint.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index fb7d3f20c..a1980a422 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -41,3 +41,14 @@ jobs: run: tox -e isort -- --check - name: Run pylint Python code static checker (https://github.com/PyCQA/pylint) run: tox -e pylint + - name: Ensure no merge-commits in the Pull Request (PR) + if: github.event_name == 'pull_request' + run: | + HEAD_SHA="${{ github.event.pull_request.head.sha }}" + echo "GITHUB_BASE_REF: ${GITHUB_BASE_REF}" + echo "HEAD_SHA: ${HEAD_SHA}" + MERGE_COMMITS=$(git rev-list --merges origin/${GITHUB_BASE_REF}..${HEAD_SHA}) + if [[ -n "${MERGE_COMMITS}" ]]; then + echo "ERROR: The Pull Request (PR) contains a 'merge commit': ${MERGE_COMMITS}" + exit 1 + fi From bba473007c035c89a67502b114fa353733b188f8 Mon Sep 17 00:00:00 2001 From: "John L. Villalovos" Date: Sat, 27 Jan 2024 19:04:11 -0800 Subject: [PATCH 2/2] chore: testing stuff. Do NOT merge. --- README.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.rst b/README.rst index 1a4765c70..fa0f5e6c1 100644 --- a/README.rst +++ b/README.rst @@ -1,6 +1,8 @@ python-gitlab ============= +Hi! + .. image:: https://github.com/python-gitlab/python-gitlab/workflows/Test/badge.svg :target: https://github.com/python-gitlab/python-gitlab/actions