用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/konflux-ci/rpmbuild-pipeline --skill download-artifacts命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | download-artifacts |
| description | Download artifacts and logs from Konflux Tekton PipelineRuns with interactive task selection |
| trigger | Use when user needs to inspect build artifacts (RPMs, SBOMs) or logs from Konflux pipelines, or wants to download outputs from specific tasks |
Download artifacts and logs from Konflux Tekton PipelineRuns, organizing them by task for easy debugging and inspection.
oc login session)<pipelinerun>/<task>/ directory structureRequired tools (skill checks automatically on startup):
oc login <cluster>)Optional tools for accessing archived PipelineRuns:
Check all required tools are available:
# The skill's check_tools() function handles this automatically
# If tools are missing, it shows installation links and exits
Verify logged into cluster:
# The skill checks oc/kubectl whoami
# If not logged in, instructs user to run: oc login <cluster-url>
If user provided PipelineRun name as argument: Use it directly
If no PipelineRun specified: List recent PipelineRuns
# Fetch recent PipelineRuns from namespace
kubectl get pipelinerun -n <namespace> -o json
# Display up to 20 most recent with:
# - Name
# - Status (Succeeded/Failed/Running)
# - Creation timestamp
# Let user select by number or type 'a' to search kubearchive
# If no live PipelineRuns found, automatically try kubearchive (if installed):
kubectl ka get pipelinerun --namespace <namespace> --limit 50
Kubearchive Support:
kubectl ka get pipelinerun --namespace <ns>Get full PipelineRun JSON to extract task information:
# From live cluster
kubectl get pipelinerun <name> -n <namespace> -o json
# OR from kubearchive (for archived PipelineRuns)
kubectl ka get pipelinerun <name> --namespace <namespace>
IMPORTANT: Use correct Tekton v1 API!
childReferences structure:
status:
childReferences:
- name: taskrun-xyz
kind: TaskRun
pipelineTaskName: my-task
# NO .status field here!
To get task status:
.status.childReferences[]kubectl get taskrun <name> -o jsonpath='{.status.conditions[0].reason}'Show numbered list:
Available tasks:
----------------
1) clone-repository Succeeded
2) process-sources Succeeded
3) rpmbuild-x86-64 Succeeded
4) rpmbuild-aarch64 Failed
5) check-noarch Succeeded
6) show-summary Succeeded
Accept input:
1,3,5all for everythingFor each selected task:
Get TaskRun results to find artifact URIs:
kubectl get taskrun <taskrun-name> -n <namespace> -o json
# Look in .status.results[] for entries where .name ends with "-artifact"
# Extract .value (the OCI artifact URI)
Download using podman (preferred) or oras fallback:
IMPORTANT: Prefer podman with build-trusted-artifacts over oras!
oras pull only works with manifest digests (will fail with "not found")build-trusted-artifacts uses oras blob fetch which handles both digest types# Option 1: podman with build-trusted-artifacts (PREFERRED - handles blob digests)
podman run --rm \
-v <auth-file>:/run/containers/0/auth.json:ro \
-v <output-path>:/tmp/output:Z \
quay.io/konflux-ci/build-trusted-artifacts@sha256:90a188e90bf8f33cf93016bcfdfd0a3a9e7df6ff13691f001a0ed4f014060e2e \
use <artifact-uri>=/tmp/output
# Option 2: oras (lightweight but only works with manifest digests)
oras pull <artifact-uri> -o <output-path> --registry-config <auth-file>
Get per-step logs:
# For live TaskRuns
# Get step names from TaskRun
kubectl get taskrun <name> -n <namespace> -o jsonpath='{.status.steps[*].name}'
# Download each step's log
tkn taskrun logs <taskrun-name> -n <namespace> -s <step-name> > <output>/<step-name>.log
# For archived TaskRuns (from kubearchive)
# Extract logs from .status.steps[].terminated.message field
# Note: Archived logs may be limited compared to live logs retrieved via tkn
kubectl ka get taskrun <name> --namespace <namespace> | \
jq -r '.status.steps[] | select(.name == "<step-name>") | .terminated.message'
Organize downloads as:
<pipelinerun-name>/
<task-name-1>/
<artifact-name-1>/
artifact-file.rpm
artifact-file.sbom.json
<artifact-name-2>/
...
step-1.log
step-2.log
<task-name-2>/
step-1.log
step-2.log
Important: Each artifact result (e.g., SOURCE_ARTIFACT, dependencies-artifact, rpmbuild-artifact) is downloaded to its own subdirectory within the task directory. This keeps artifacts organized and prevents filename collisions.
Example summary:
Downloaded 8/10 tasks successfully:
✓ rpmbuild-x86-64 (artifacts + logs)
✓ check-noarch (logs only, no artifacts)
✗ rpmbuild-i686 (artifact download failed)
✗ calculate-deps (TaskRun not found)
If output directory exists:
Show simple progress during download:
ℹ Downloading task 3/10: rpmbuild-x86-64
✓ rpmbuild-x86-64 (artifacts + logs)
ℹ Downloading task 4/10: check-noarch
✓ check-noarch (logs only)
/download-artifacts
/download-artifacts my-build-run-abc123
/download-artifacts my-build-run --namespace my-tenant --output-dir /tmp/builds
/download-artifacts my-run -n my-namespace -o ./artifacts
WRONG (will always return "Unknown"):
.status.childReferences[] | .status # childReferences don't have .status!
CORRECT:
# Get TaskRun name from childReferences
taskrun_name=$(echo "$pr_json" | jq -r '.status.childReferences[] | select(.pipelineTaskName == "my-task") | .name')
# Fetch actual TaskRun to get status
status=$(kubectl get taskrun "$taskrun_name" -o jsonpath='{.status.conditions[0].reason}')
When tasks are retried, multiple TaskRuns exist for same task:
.pipelineTaskNameTrusted Artifacts are stored as OCI artifacts:
oci://quay.io/redhat-user-workloads/.../package@sha256:digestbuild-trusted-artifacts container uses oras blob fetch which handles both digest typesoras pull only works with manifest digests and will fail with "not found" for blob digestsIf PipelineRun is still Running:
Run: oc login <cluster-api-url>
Check namespace: oc project or use -n flag
If PipelineRuns have been archived, install kubectl ka:
# Install KubeArchive CLI plugin
# See: https://kubearchive.github.io/kubearchive/main/cli/installation.html
# Search for archived PipelineRuns
kubectl ka get pipelinerun --namespace <namespace>
Install Tekton CLI: https://tekton.dev/docs/cli/
Install jq: https://jqlang.github.io/jq/download/
If using oras, you may see "not found" errors for blob digests. Solutions:
The script prefers podman over oras because TaskRun results often contain blob digests rather than manifest digests.
Verify cluster access:
oc auth can-i get pipelineruns -n <namespace>
oc auth can-i get taskruns -n <namespace>
The actual implementation script is:
.claude/skills/download-artifacts/download-artifacts.sh
It contains:
Invoke it via the skill system, which handles argument passing and execution context.