diff --git a/.github/workflows/crux-sync.yml b/.github/workflows/crux-sync.yml index 079b40d8f8..837df39a7d 100644 --- a/.github/workflows/crux-sync.yml +++ b/.github/workflows/crux-sync.yml @@ -119,6 +119,10 @@ jobs: git config user.name "hive-release[bot]" git config user.email "hive-release@hive.kubestellar.io" git add -A + # .hive-sync carries a timestamp, so it alone is not a change worth a commit. + if [ "$(git diff --cached --name-only)" = ".hive-sync" ]; then + git restore --staged --worktree .hive-sync + fi if git diff --cached --quiet; then echo "changed=false" >> "$GITHUB_OUTPUT" echo "Publish tree already matches hive@${HIVE_SHA:0:12}; nothing to commit." | tee -a "$GITHUB_STEP_SUMMARY" @@ -131,7 +135,7 @@ jobs: -m "Module path rewritten github.com/hivecommons/hive/crux -> github.com/hivecommons/crux by src/scripts/crux-publish.sh. File issues and pull requests in hivecommons/hive." echo "changed=true" >> "$GITHUB_OUTPUT" echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" - git --no-pager show --stat HEAD | head -40 + git --no-pager show --shortstat --format="%H %s" HEAD - name: Upload publish tree uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 diff --git a/changelog.d/fixed-14138-crux-sync-sigpipe.md b/changelog.d/fixed-14138-crux-sync-sigpipe.md new file mode 100644 index 0000000000..2c74b67138 --- /dev/null +++ b/changelog.d/fixed-14138-crux-sync-sigpipe.md @@ -0,0 +1,2 @@ +- The `crux-sync` workflow no longer aborts after committing the publish tree: the commit summary was piped through `head`, which under `pipefail` turned into exit 141 on a large first sync (#14138). +- `crux-sync` no longer commits when the only difference is the `.hive-sync` timestamp, so tag-only runs and re-dispatches do not add empty syncs (#14138).