Skip to content

Commit 16fdc9b

Browse files
committed
fix: Update submodule when tag created workflow
1 parent 1d59621 commit 16fdc9b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

.github/workflows/tag.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,21 @@ jobs:
2828
VERSION=$(jq -r .version package.json)
2929
echo "version=$VERSION" >> $GITHUB_OUTPUT
3030
31-
- name: Update submodules recursively
31+
- name: Update submodules recursively and stage updates
3232
continue-on-error: true
3333
run: |
3434
echo "Updating submodules recursively..."
3535
git submodule update --recursive --remote || echo "Submodule update failed or no changes."
3636
37+
echo "Staging submodule pointer updates..."
38+
git submodule foreach --quiet 'git fetch && git checkout origin/$(git rev-parse --abbrev-ref HEAD) && cd $toplevel && git add $name'
39+
3740
- name: Commit submodule updates if any
3841
continue-on-error: true
3942
run: |
40-
if ! git diff --quiet; then
43+
if ! git diff --cached --quiet; then
4144
VERSION="${{ steps.get_version.outputs.version }}"
42-
echo "Committing submodule updates..."
43-
git add .
45+
echo "Committing submodule pointer changes..."
4446
git commit -m "bot: Update supabase server for domain-locker v${VERSION}" || echo "Nothing to commit"
4547
git push origin HEAD || echo "Push failed or nothing to push"
4648
else

0 commit comments

Comments
 (0)