2026-03 GitHub Actions ログ artifact 保管・構造化要件¶
位置づけ¶
本ドキュメントは、CI/CD 実行時の GitHub Actions ログを GitHub artifact に保管し、あとから解析可能にするための追加合意事項です。
目的は、GitHub UI 上の一時的な job log だけに依存せず、workflow run / job / step / attachment の対応関係を機械可読に残すことです。
適用範囲¶
初回の適用対象は以下とします。
ci-pr-develop.ymlci-pr-main.ymlci-push-develop.ymle2e-full.ymlstaging-smoke-storefront.ymllighthouse-ci.ymldeploy-staging.ymldeploy-production.yml
追加合意事項¶
- GitHub Actions の各対象 workflow run について、workflow-level artifact を必須とする。
- workflow-level artifact には、少なくとも以下を含める。
manifest.jsonci-run.jsonai-summary.jsonai-summary.mdartifacts.jsonfailed-step-tails/*.logjobs/<job-id>/job.jsonjobs/<job-id>/steps.jsonjobs/<job-id>/github-log.txtsummary.mdci-run.jsonを AI 向け triage の第一入力 とし、raw log 全文より優先する。github-log.txtは 成功・失敗を問わず全 run で保存する。- E2E / smoke / deploy などで job log 以外の補助ログがある場合は、job-local attachment artifact として別 artifact に保存してよい。
- retention は 7 日を既定 とし、triage 都合で明示 override が必要な workflow のみ 14 日または 30 日を許容する。
- 既存の GitHub masking を前提とし、collector 側では最小限の補助 redaction のみを許容する。
.env、Secrets Manager の dump、credential file、secret bulk input など、機微情報の平文を含みうるファイルは artifact 対象外とする。
構造化ログの識別子¶
trace_id¶
- 各 workflow run に対して
trace_idを 1 つ必須とする。 trace_idは 32 文字の 16 進文字列とし、以下の入力から決定的に生成する。repositoryrun_idrun_attempt- 目的は、同一 run に属する manifest / raw log / attachment を相関できるようにすること。
span_id¶
- 各 job には
span_id相当の識別子を持たせてよい。 span_idは 16 文字の 16 進文字列とし、trace_idと job identity から決定的に生成する。- OTel backend 連携は初回スコープ外だが、識別子長は将来の連携を妨げない形式に寄せる。
artifact 命名規則¶
workflow-level artifact¶
ci-logs-<run_id>-<run_attempt>-<workflow-slug>
job-local attachment artifact¶
gha-job-attachments-<workflow-slug>-<job-key>-<suffix>
補足:
workflow-slugは YAML ファイル名相当の安定した識別子を用いる。job-keyは GitHub Actions の job key、またはそれに準ずる安定識別子を用いる。- matrix / shard がある場合は suffix に含める。
manifest.json の必須項目¶
schemaVersiontraceIdrepositoryworkflow.nameworkflow.slugrun.idrun.attemptrun.eventNamerun.refrun.sharun.actorrun.statusrun.conclusionrun.startedAtrun.completedAtretentionDaysstandardizedTelemetry.ciRunPathstandardizedTelemetry.aiSummaryJsonPathstandardizedTelemetry.aiSummaryMarkdownPathstandardizedTelemetry.failedStepTailDir
workflow_run 起点の workflow では、以下も保持する。
run.sourceWorkflowRunId
job.json / steps.json の必須項目¶
job.json¶
jobIdnametraceIdspanIdstatusconclusionstartedAtcompletedAtdurationMsrunnerNamerunnerGroupNamelabels
steps.json¶
各 step ごとに以下を保持する。
namestatusduration_msstarted_atfinished_aterror.typeerror.message_taillog_tail_path
ci-run.json の必須項目¶
schema_versiontrace_idcicd.pipeline.namecicd.pipeline.run_idcicd.pipeline.run_attemptcicd.job.namerepository.full_namerepository.ref_namerepository.revisionrun.statussteps[].namesteps[].statussteps[].duration_mssteps[].error.typesteps[].error.message_tail
補足:
ci-run.jsonは run 全体の代表 job / 失敗 step を top-level に持ちつつ、jobs[]で全 job の正規化結果を保持してよい。steps[].error.typeは少なくともtimeout/dependency_install_error/compile_error/typecheck_error/test_failure/e2e_failure/deploy_error/auth_error/network_error/unknownの enum に寄せる。steps[].error.message_tailは mask 済みかつ 4000 文字以下とする。
AI summary 契約¶
ai-summary.json / ai-summary.md には少なくとも以下を含める。
failed_steperror_typesuspected_causereproducibilityfix_candidatesconfidence
AI へ渡す入力順位は次に固定する。
ci-run.jsonfailed-step-tails/*.log- テストレポートや screenshot / trace
jobs/<job-id>/github-log.txt
attachment manifest の必須項目¶
job-local attachment artifact には manifest.json を必須とし、以下を含める。
schemaVersiontraceIdworkflow.slugrun.idrun.attemptjob.keyjob.nameattachmentKindfiles[].relativePathfiles[].sourcePathfiles[].sizeBytesfiles[].sha256detectedManifests[]detectedManifests[].kinddetectedManifests[].relativePath
detectedManifests[] は attachment bundle 内に含まれる nested
manifest を列挙し、少なくとも以下の kind を識別できること。
playwright-artifactssentry-diagnosticsworkflow-archive
可能な場合は nested manifest 側の traceId / workflowTraceId / app /
suite / environment も保持し、attachment
manifest だけで次に辿る bundle を判断できるようにする。
受け入れ観点¶
- 任意の対象 workflow run について、artifact を見れば
trace_idと run/job/step の対応関係が分かること。 - 各 job の raw log が artifact 内に存在すること。
- E2E service log や deploy 補助ログがある job では、対応する attachment artifact を辿れること。
workflow_run起点の workflow では、元のworkflow_run.idを manifest から確認できること。- secret 値そのものが artifact に平文で含まれないこと。