Skip to content

Commit 4fadb30

Browse files
authored
fix(ci): render the build Step Summary (hashFiles cannot guard a RUNNER_TEMP file) (#5)
The Build summary step guarded its run with hashFiles(runner.temp/build-summary.json), but hashFiles() only resolves paths inside GITHUB_WORKSPACE - a RUNNER_TEMP path never matches, so the step was always skipped and no Step Summary rendered. Run on success() instead (the dev build always writes the JSON), with an in-script existence fallback. Workflow-only fix; the package and content hashes are unchanged.
1 parent ae4da87 commit 4fadb30

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

.github/workflows/build.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,10 @@ jobs:
117117

118118
# Render the dev build's content shas + a copy-paste promotion command per function
119119
# into the run's Step Summary (the build JSON is otherwise buried in step logs).
120+
# NB: the JSON lives in RUNNER_TEMP (outside the workspace), so hashFiles() can't guard
121+
# it - run on success() and skip inside the script if the file is somehow absent.
120122
- name: Build summary (content shas + promote commands)
121-
if: ${{ hashFiles(format('{0}/build-summary.json', runner.temp)) != '' }}
123+
if: success()
122124
env:
123125
SUMMARY_JSON: ${{ runner.temp }}/build-summary.json
124126
PROMOTION_REPO: ${{ inputs.promotion_repo }}
@@ -129,9 +131,13 @@ jobs:
129131
SRC_COMMIT: ${{ github.sha }}
130132
run: |
131133
python3 - <<'PY'
132-
import json, os
134+
import json, os, sys
133135
134-
rows = json.load(open(os.environ["SUMMARY_JSON"]))
136+
path = os.environ["SUMMARY_JSON"]
137+
if not os.path.exists(path):
138+
print(f"::notice::no build summary JSON at {path}; skipping summary.")
139+
sys.exit(0)
140+
rows = json.load(open(path))
135141
repo = os.environ["PROMOTION_REPO"]
136142
wf = os.environ["PROMOTION_WORKFLOW"]
137143
project = os.environ["PROJECT"]

0 commit comments

Comments
 (0)