Skip to content

How do I check if a submodule changed commit against the source branch? #2217

Answered by jackton1
vib-etched asked this question in Q&A
Discussion options

You must be logged in to vote

HI @vib-etched, here’s how you can check for changes in a submodule path.

name: Check Submodule Changes

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

jobs:
  check-submodule-changes:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4
        with:
          fetch-depth: 0  # Fetch full history
          submodules: true  # Ensure submodules are included=

      - name: Get changed files including submodules
        id: changed-files
        uses: tj-actions/changed-files@v44
        # No need to set `exclude_submodules` as it defaults to `false`

      - name: Check if submodule changed
        run: 

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
1 reply
@vib-etched
Comment options

Answer selected by jackton1
Comment options

You must be logged in to vote
5 replies
@jackton1
Comment options

@prabhukiran9999
Comment options

@jackton1
Comment options

@prabhukiran9999
Comment options

@jackton1
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants