From 0aac99aca51b233a79a4cc16f18b66e8e18c0338 Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Sun, 16 Mar 2025 21:41:21 +0100 Subject: [PATCH 1/2] Add automatic message on submodule modifications --- .github/ghprcomment.yml | 6 ++++++ .github/workflows/on-pr-opened.yml | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/.github/ghprcomment.yml b/.github/ghprcomment.yml index 8cb28f618df..d7d4e1fd6ba 100644 --- a/.github/ghprcomment.yml +++ b/.github/ghprcomment.yml @@ -91,3 +91,9 @@ Please [merge `upstream/main`](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork#syncing-a-fork-branch-from-the-command-line) with your code. For a step-by-step guide to resolve merge conflicts, see . +- jobName: 'Submodules not modified' + message: > + Your pull request modified git submodules. + + + Please follow our [FAQ on submodules](https://devdocs.jabref.org/code-howtos/faq.html#submodules) to fix. diff --git a/.github/workflows/on-pr-opened.yml b/.github/workflows/on-pr-opened.yml index 76710bad221..3c050af0902 100644 --- a/.github/workflows/on-pr-opened.yml +++ b/.github/workflows/on-pr-opened.yml @@ -63,6 +63,25 @@ jobs: echo "✅ No merge conflicts" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + unmodified_submodules: + name: Submodules not modified + if: github.actor != 'dependabot[bot]' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: true + show-progress: 'false' + - name: Check for submodule modifications + id: check_submodule + run: | + git fetch origin ${{ github.base_ref }} + DIFF=$(git diff --submodule=log origin/${{ github.base_ref }} HEAD) + if [ -n "$DIFF" ]; then + echo "❌ Submodule modifications detected" + exit 1 + fi + echo "✅ No submodule modifications" upload-pr-number: runs-on: ubuntu-latest steps: From 813c41554a708aa385bc979507dc6cd94762fd74 Mon Sep 17 00:00:00 2001 From: Subhramit Basu Date: Mon, 17 Mar 2025 02:15:24 +0530 Subject: [PATCH 2/2] Remove extra newline --- .github/ghprcomment.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/ghprcomment.yml b/.github/ghprcomment.yml index d7d4e1fd6ba..535b54577cd 100644 --- a/.github/ghprcomment.yml +++ b/.github/ghprcomment.yml @@ -95,5 +95,4 @@ message: > Your pull request modified git submodules. - Please follow our [FAQ on submodules](https://devdocs.jabref.org/code-howtos/faq.html#submodules) to fix.