From fa5859618e4166c742708b8d21c89aa6bc787c8c Mon Sep 17 00:00:00 2001 From: "yk-lab (k.yamada)" Date: Tue, 23 Jun 2026 02:25:32 +0900 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20=E3=82=B8=E3=83=A7=E3=83=96?= =?UTF-8?q?=E3=82=B5=E3=83=9E=E3=83=AA=E3=81=AB=E5=B0=8E=E5=85=A5=E7=B5=90?= =?UTF-8?q?=E6=9E=9C=E3=82=92=E5=87=BA=E5=8A=9B=EF=BC=88NFR-5=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - core.summary にバージョン・アセット・取得元・cache・checksum・実行ファイルパスを表形式で記載 - cache hit 時は checksum を n/a、skip-checksum 時は skipped、通常時は verified と表示 --- src/main.ts | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/main.ts b/src/main.ts index 25368ab..87f9511 100644 --- a/src/main.ts +++ b/src/main.ts @@ -18,6 +18,16 @@ async function run(): Promise { const checkLatest = core.getBooleanInput('check-latest'); const skipChecksum = core.getBooleanInput('skip-checksum'); + // Summary state collected during the run and written at the end (NFR-5). + const summary = { + version: '', + asset: '', + source: 'go-task/task GitHub Releases', + cache: 'miss', + checksum: 'n/a', + path: '', + }; + // Mask the token so it can never leak into logs/summaries (NFR-1). if (token) { core.setSecret(token); @@ -31,6 +41,7 @@ async function run(): Promise { } const asset = resolveAsset(process.platform, process.arch, archOverride || undefined); + summary.asset = asset.assetName; core.debug(`Target asset: ${asset.assetName}`); // 1. Resolve the concrete version (FR-1). For a range with check-latest=false, @@ -47,10 +58,12 @@ async function run(): Promise { }); core.info(`Resolved go-task version: ${version}`); } + summary.version = version; // 2. Tool-cache lookup (FR-7). let toolDir = tc.find(TOOL_NAME, version, asset.arch); const cacheHit = Boolean(toolDir); + summary.cache = cacheHit ? 'hit' : 'miss'; if (cacheHit) { core.info(`Restored task ${version} from tool cache.`); @@ -67,6 +80,7 @@ async function run(): Promise { // 4. Checksum verification (FR-5). if (skipChecksum) { + summary.checksum = 'skipped'; core.warning('Checksum verification skipped (skip-checksum=true).'); } else { const expected = await withRetry(() => fetchChecksum(tag, asset.assetName, token || undefined), { @@ -80,6 +94,7 @@ async function run(): Promise { ); } verifyChecksum(archivePath, expected); + summary.checksum = 'verified (SHA256)'; core.info('Checksum verified (SHA256).'); } @@ -90,6 +105,7 @@ async function run(): Promise { // 6. Ensure executable + expose on PATH (FR-6/FR-8). const binPath = path.join(toolDir, asset.binaryName); + summary.path = binPath; if (process.platform !== 'win32') { try { fs.chmodSync(binPath, 0o755); @@ -104,6 +120,20 @@ async function run(): Promise { core.setOutput('task-path', binPath); core.setOutput('cache-hit', String(cacheHit)); core.info(`task ${version} is ready at ${binPath}`); + + // 8. Job summary (NFR-5). + core.summary + .addHeading('Setup Task') + .addTable([ + [{ data: 'Item', header: true }, { data: 'Value', header: true }], + ['Version', summary.version], + ['Asset', summary.asset], + ['Source', summary.source], + ['Cache', summary.cache], + ['Checksum', summary.checksum], + ['Executable', summary.path], + ]) + .write(); } run().catch((err: unknown) => { From 9cbf224c048f841b804a43db5c93b2d5a5f55e45 Mon Sep 17 00:00:00 2001 From: "yk-lab (k.yamada)" Date: Tue, 23 Jun 2026 02:32:23 +0900 Subject: [PATCH 2/3] =?UTF-8?q?ci:=20bridge=20job=20=E3=81=8C=20changes=20?= =?UTF-8?q?job=20=E3=81=AE=E5=A4=B1=E6=95=97=E3=82=92=E6=AD=A3=E3=81=97?= =?UTF-8?q?=E3=81=8F=E6=A4=9C=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ci.yml check-gate: changes / check の failure/cancelled を両方確認 - self-test.yml self-test-gate: changes / matrix / skip-checksum の failure/cancelled を確認 - self-test.yml: dorny/paths-filter 用に pull-requests: read を追加 --- .github/workflows/ci.yml | 20 +++++++++++++------- .github/workflows/self-test.yml | 28 +++++++++++++++------------- 2 files changed, 28 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6e5b9e2..57e4710 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -96,10 +96,16 @@ jobs: if: always() runs-on: ubuntu-latest steps: - - name: Check passed or skipped - if: ${{ needs.check.result == 'success' || needs.check.result == 'skipped' }} - run: echo "CI check passed or skipped (markdown-only changes)." - - - name: Check failed - if: ${{ needs.check.result == 'failure' }} - run: exit 1 + - name: Report status + run: | + changes="${{ needs.changes.result }}" + check="${{ needs.check.result }}" + if [ "$changes" == "failure" ] || [ "$check" == "failure" ]; then + echo "::error::CI failed (changes=$changes, check=$check)" + exit 1 + fi + if [ "$changes" == "cancelled" ] || [ "$check" == "cancelled" ]; then + echo "::error::CI was cancelled (changes=$changes, check=$check)" + exit 1 + fi + echo "CI check passed or skipped (markdown-only changes)." diff --git a/.github/workflows/self-test.yml b/.github/workflows/self-test.yml index 26c2525..d36cd27 100644 --- a/.github/workflows/self-test.yml +++ b/.github/workflows/self-test.yml @@ -7,6 +7,7 @@ on: permissions: contents: read + pull-requests: read # dorny/paths-filter needs PR base/head on pull_request events concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -144,16 +145,17 @@ jobs: if: always() runs-on: ubuntu-latest steps: - - name: Self-test passed or skipped - if: ${{ - (needs.matrix.result == 'success' || needs.matrix.result == 'skipped') && - (needs.skip-checksum.result == 'success' || needs.skip-checksum.result == 'skipped') - }} - run: echo "Self-test passed or skipped (markdown-only changes)." - - - name: Self-test failed - if: ${{ - needs.matrix.result == 'failure' || - needs.skip-checksum.result == 'failure' - }} - run: exit 1 + - name: Report status + run: | + changes="${{ needs.changes.result }}" + matrix="${{ needs.matrix.result }}" + skip="${{ needs.skip-checksum.result }}" + if [ "$changes" == "failure" ] || [ "$matrix" == "failure" ] || [ "$skip" == "failure" ]; then + echo "::error::Self-test failed (changes=$changes, matrix=$matrix, skip-checksum=$skip)" + exit 1 + fi + if [ "$changes" == "cancelled" ] || [ "$matrix" == "cancelled" ] || [ "$skip" == "cancelled" ]; then + echo "::error::Self-test was cancelled (changes=$changes, matrix=$matrix, skip-checksum=$skip)" + exit 1 + fi + echo "Self-test passed or skipped (markdown-only changes)." From 766a51c6cab814e7191924f23c68a6ebf93b1d2d Mon Sep 17 00:00:00 2001 From: "yk-lab (k.yamada)" Date: Tue, 23 Jun 2026 02:41:42 +0900 Subject: [PATCH 3/3] feat: await core.summary.write() and rephrase comment - core.summary.write() returns a Promise; await it in the async run() function - Rephrase the comment so it does not introduce an 8th step to the fixed 7-step pipeline --- src/main.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.ts b/src/main.ts index 87f9511..abfcde5 100644 --- a/src/main.ts +++ b/src/main.ts @@ -121,8 +121,8 @@ async function run(): Promise { core.setOutput('cache-hit', String(cacheHit)); core.info(`task ${version} is ready at ${binPath}`); - // 8. Job summary (NFR-5). - core.summary + // Emit a job summary after the fixed pipeline completes (NFR-5). + await core.summary .addHeading('Setup Task') .addTable([ [{ data: 'Item', header: true }, { data: 'Value', header: true }],