Skip to content

fix(ci): stop sync-from-npm racing tar against grep -q - #1

Open
wangqianqianjun wants to merge 1 commit into
mainfrom
fix-sync-from-npm-sigpipe
Open

wangqianqianjun wants to merge 1 commit into
mainfrom
fix-sync-from-npm-sigpipe

Conversation

@wangqianqianjun

Copy link
Copy Markdown
Contributor

Background

gh workflow run sync-from-npm.yml -R FutrixDev/magic-art-skill -f version=0.5.0 failed twice in a row (runs 34344335720, both attempts) with:

tar: stdout: write error
##[error]Process completed with exit code 2.

This blocks mirroring @magic-art/cli@0.5.0 (already published to npm) into skills/magic-art, the v0.5.0 tag, and the ClawHub publish.

Solution

The guard step was:

tar -tzf "$WORK"/magic-art-cli-*.tgz | grep -q '^package/skill/SKILL.md$'

grep -q exits as soon as it matches. If tar still has entries to write it gets EPIPE and exits non-zero, and set -o pipefail turns that into a failed step. Whether tar loses the race depends on scheduling — which is why this exact line passed for every earlier release and then failed deterministically on the runner for 0.5.0.

Fix: list to a file, then grep the file, so tar always runs to completion. The guard's intent (fail loudly if the tarball has no skill/SKILL.md) is unchanged.

Verified locally against the real published 0.5.0 tarball: guard passes, 41 entries listed.

Affected Files

  • .github/workflows/sync-from-npm.yml — guard step only

🤖 Generated with Claude Code

Background: `gh workflow run sync-from-npm.yml -f version=0.5.0` failed twice in
a row with `tar: stdout: write error` on the guard step, blocking the
@magic-art/cli@0.5.0 mirror + ClawHub publish.

Solution: the guard piped `tar -tzf <tarball>` into `grep -q`. grep exits at the
first match; if tar still has entries to write it gets EPIPE and exits non-zero,
and `set -o pipefail` propagates that as a step failure. It is a race, which is
why the same line passed for every earlier release and then failed on both
0.5.0 attempts. Write the listing to a file and grep the file, so tar always
runs to completion. Verified against the real 0.5.0 tarball locally: guard
passes, 41 entries listed.

Affected Files: .github/workflows/sync-from-npm.yml

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant