Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add automatic message on submodule modifications #12752

Merged
merged 2 commits into from
Mar 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/ghprcomment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,8 @@

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 <https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/resolving-a-merge-conflict-using-the-command-line>.
- 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.
19 changes: 19 additions & 0 deletions .github/workflows/on-pr-opened.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading