fix(release): release job 放行 skipped 依赖 - #1647
Conversation
build-mobile 在 RELEASE_MOBILE_ENABLED 未启用时跳过,needs 依赖被跳过 使 release job 也默认跳过(rc.5 已证实产物齐全但未发版)。加 if: !cancelled() && !contains(needs.*.result, 'failure'):放行 skipped、 仍拦截 failure 与取消。
📝 WalkthroughWalkthroughThe release job now runs when dependencies are skipped, but not when a dependency fails or the workflow is cancelled. ChangesRelease workflow
Estimated code review effort: 1 (Trivial) | ~5 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/release.yml:
- Around line 351-353: Condition the mobile artifact download step on
build-mobile completing successfully by adding an if expression using
needs.build-mobile.result == 'success'. Keep the release job’s existing failure
and cancellation gating unchanged, while ensuring skipped build-mobile does not
attempt the download.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 5aadc128-021f-4aba-a8f1-1bab99447fa5
📒 Files selected for processing (1)
.github/workflows/release.yml
| # build-mobile 未启用时(RELEASE_MOBILE_ENABLED != true)会 skipped, | ||
| # needs 依赖被跳过会使下游默认跳过;显式放行 skipped、仍拦截 failure。 | ||
| if: ${{ !cancelled() && !contains(needs.*.result, 'failure') }} |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== workflow outline/relevant lines =="
wc -l .github/workflows/release.yml
sed -n '310,410p' .github/workflows/release.yml
echo
echo "== search for build-mobile / mobile-artifacts / release_mobile_enabled =="
rg -n "build-mobile|mobile-artifacts|RELEASE_MOBILE_ENABLED|download-artifact|upload-artifact" .github/workflows/release.yml
echo
echo "== run yaml parse check if available =="
python3 - <<'PY'
from pathlib import Path
p = Path('.github/workflows/release.yml')
if p.exists():
text = p.read_text()
print("file exists and length:", len(text.splitlines()))
else:
print("missing")
PYRepository: TokenDanceLab/AgentHub
Length of output: 3817
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== workflow outline/relevant lines =="
wc -l .github/workflows/release.yml
sed -n '310,410p' .github/workflows/release.yml
echo
echo "== search for build-mobile / mobile-artifacts / release_mobile_enabled =="
rg -n "build-mobile|mobile-artifacts|RELEASE_MOBILE_ENABLED|download-artifact|upload-artifact" .github/workflows/release.yml
echo
echo "== run yaml parse check if available =="
python3 - <<'PY'
from pathlib import Path
p = Path('.github/workflows/release.yml')
if p.exists():
text = p.read_text()
<<<<<<< HEAD
print("file exists and length:", len(text.splitlines()))
=======
print("file exists and length:", len(text.splitlines()))
>>>>>>> release
PYRepository: TokenDanceLab/AgentHub
Length of output: 3865
🌐 Web query:
actions/download-artifact v8 missing artifact error job fails not skipped
💡 Result:
The "Artifact not found" error when using actions/download-artifact@v8 typically indicates that the action cannot locate the specified artifact within the context of the current repository and run ID [1][2]. Because the job fails (instead of skipping), this confirms that the action is actively searching and failing to find the resource, rather than the step being logically skipped [3][4]. To resolve this, ensure the following configurations are met: 1. Verify Version Compatibility: Ensure that you are using actions/upload-artifact@v4 (or newer) to upload the artifact. The v4+ versions of upload/download actions use a different storage mechanism than older versions, and they are not cross-compatible [5][6]. 2. Check Permissions for Cross-Workflow Downloads: If you are downloading an artifact from a different workflow run (e.g., in a workflow_run trigger), the action requires specific permissions. You must add the following to your workflow file [1]: permissions: actions: read contents: read 3. Explicitly Define Inputs for Cross-Workflow Runs: When downloading from a different run, the action often requires explicit definition of the github-token, repository, and run-id, even if they match the defaults [1][2]. - name: Download Artifact uses: actions/download-artifact@v8 with: name: your-artifact-name github-token: ${{ github.token }} run-id: ${{ github.event.workflow_run.id }} repository: ${{ github.repository }} 4. Artifact Availability: Ensure the artifact has not expired [3][7]. Additionally, some users have noted that artifacts may not be immediately available if a job is part of a large matrix or if the upload step has not fully completed/flushed to the storage backend before the download step begins [8]. If the job fails without a clear error message (sometimes seen on Windows runners), it may be due to underlying Node.js crashes rather than a configuration error [4]. In such cases, check the debug logs (by setting ACTIONS_STEP_DEBUG=true in your secrets) to identify potential stack buffer overflows or environment-specific failures [4].
Citations:
- 1: ci: fix cross-workflow artifact download permission go-swagger/go-swagger#3344
- 2: https://github.com/actions/download-artifact
- 3: https://stackoverflow.com/questions/78506218/unable-to-download-artifacts-artifact-not-found-for-name-java-app
- 4: [bug] Action failed without any error message actions/download-artifact#475
- 5: [bug] Unable to download artifact(s): Artifact not found for name: <artifact-name> actions/download-artifact#250
- 6: https://stackoverflow.com/questions/78238187/unable-to-find-any-artifacts-for-the-associated-workflow-github-actions
- 7: threadbare-linux-metadata artifact not being attached to releases endlessm/threadbare#2062
- 8: [bug] Artifacts not available for followup job (v4) actions/download-artifact#281
为可选移动端构建条件化 artifact 下载。
当 RELEASE_MOBILE_ENABLED != 'true' 时,build-mobile 不会上传 mobile-artifacts;release 仍会执行,继续下载该 artifact 会失败。请在下载步骤添加 if: ${{ needs.build-mobile.result == 'success' }},或让条件不允许跳过 build-mobile 时进入 release。
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/release.yml around lines 351 - 353, Condition the mobile
artifact download step on build-mobile completing successfully by adding an if
expression using needs.build-mobile.result == 'success'. Keep the release job’s
existing failure and cancellation gating unchanged, while ensuring skipped
build-mobile does not attempt the download.
Source: MCP tools
Summary
build-mobile在RELEASE_MOBILE_ENABLED未启用时跳过,GitHub Actions 的needs依赖被跳过时下游默认跳过 → rc.5 产物齐全但 release job 被 skip、未发版if: !cancelled() && !contains(needs.*.result, 'failure'),放行 skipped、仍拦截 failureTest plan
Summary by CodeRabbit