Skip to content

Commit

Permalink
Do not load submodules
Browse files Browse the repository at this point in the history
  • Loading branch information
mkirilin committed Mar 19, 2024
1 parent 2a8bafd commit 3134fdb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/ci_submodule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ jobs:
- name: Checkout source code for base
uses: actions/checkout@v4
with:
submodules: true
submodules: false
path: base

- name: Checkout source code for head
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
submodules: true
submodules: false
path: head

- name: Determine hashes to compare
Expand All @@ -39,16 +39,17 @@ jobs:
cd head
git fetch origin "${PR_BRANCH}" --recurse-submodules=no \
|| error "__Line:${LINENO}__Error: Could not fetch history of ${PR_BRANCH}"
echo "HEAD_SC_HASH=`git log -n1 sc | awk '{ print $2 }'`" >> $GITHUB_ENV
cd ../base
git fetch origin "${BASE_BRANCH}" --recurse-submodules=no \
|| error "__Line:${LINENO}__Error: Could not fetch history of ${BASE_BRANCH}"
echo "BASE_SC_HASH=`git log -n1 sc | awk '{ print $2 }'`" >> $GITHUB_ENV
cd ..
- name: Convert PR to draft if necessary
shell: bash
run: |
CHANGED=`git diff --name-only --no-index -- "${GITHUB_WORKSPACE}"/base/ "${GITHUB_WORKSPACE}"/head/` || true
if grep "^${INPUT_PATH}$" <<< "${CHANGED}"; then
if [[ "x$HEAD_SC_HASH"="x$BASE_SC_HASH" ]]; then
echo "${TOKEN}" | gh auth login --with-token
gh pr comment ${PR} --body \
"Submodule has been changed by this PR. \
Expand Down

0 comments on commit 3134fdb

Please sign in to comment.