Skip to content

Commit c7b2de5

Browse files
committed
fix: replace bash-only string slicing with cut for POSIX sh compatibility in submodule foreach
1 parent 95072c6 commit c7b2de5

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

.github/workflows/update-submodules.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ jobs:
4646
SUMMARY=$(git submodule foreach --quiet \
4747
'NEW=$(git rev-parse HEAD); \
4848
OLD=$(git -C "$toplevel" ls-tree HEAD "$sm_path" | awk "{print \$3}"); \
49-
[ "$NEW" != "$OLD" ] && echo "- **$name**: \`${OLD:0:8}\` → \`${NEW:0:8}\`" || true' \
49+
NEW8=$(echo "$NEW" | cut -c1-8); \
50+
OLD8=$(echo "$OLD" | cut -c1-8); \
51+
[ "$NEW" != "$OLD" ] && echo "- **$name**: \`$OLD8\` -> \`$NEW8\`" || true' \
5052
)
5153
echo "summary<<EOF" >> "$GITHUB_OUTPUT"
5254
echo "$SUMMARY" >> "$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)