You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a3b74da
Browse filesBrowse the repository at this point in the historyBrowse files
Fix publish summary rendering "❓ no result" for every package (#196)
* Fix publish summary showing "no result" for all packages
Root cause: gh api leaks its raw error body (with embedded quotes) to
stdout on 404s for brand-new packs, and that raw value was interpolated
directly into a jq --arg via ${{ }}, breaking the quoting and corrupting
the whole jq invocation into writing a bare boolean instead of a JSON
object. That single malformed fragment then aborted jq for every cell.
Co-authored-by: felickz <1760475+felickz@users.noreply.github.com>
* Remove committed ext/ext-library-sources lockfiles and gitignore them
Co-authored-by: felickz <1760475+felickz@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: felickz <1760475+felickz@users.noreply.github.com>
Copy file name to clipboardExpand all lines: .github/workflows/publish.yml
+57-27Lines changed: 57 additions & 27 deletions
Original file line number
Diff line number
Diff line change
@@ -34,13 +34,19 @@ jobs:
34
34
env:
35
35
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36
36
run: |
37
-
# `|| true` inside the substitution (not after it) matters: `run:` steps default to
38
-
# `bash -e`, and a brand-new pack's container doesn't exist on GHCR yet, so `gh api`
39
-
# returns 404 (non-zero). Without this, that failure would abort the step here and
40
-
# fail the job, blocking the first-ever publish of a new pack. Swallowing it leaves
41
-
# PUBLISHED_VERSION empty, which correctly differs from CURRENT_VERSION below and
42
-
# triggers a first publish.
43
-
PUBLISHED_VERSION=$(gh api /orgs/githubsecuritylab/packages/container/codeql-${{ matrix.language }}-queries/versions --jq '.[0].metadata.container.tags[0]' 2>/dev/null || true)
37
+
# A brand-new pack's container doesn't exist on GHCR yet, so `gh api` 404s. On any
38
+
# failure, force PUBLISHED_VERSION empty rather than trusting whatever ended up on
39
+
# stdout: on error, `gh api` prints the raw (unfiltered) response body there - e.g.
40
+
# `{"message":"Package not found.",...}` - even with `--jq` and even with
41
+
# `2>/dev/null`. That body's embedded double quotes previously broke out of the
42
+
# `--arg previous_version "..."` quoting in the "Record publish result" step below,
43
+
# corrupting its jq invocation into writing a bare `true`/`false` instead of a JSON
44
+
# object - which then broke the release summary table for every language, not just
45
+
# the newly-published one (this is what happened publishing v0.7.1's new go/python
46
+
# `ext` packs for the first time).
47
+
if ! PUBLISHED_VERSION=$(gh api /orgs/githubsecuritylab/packages/container/codeql-${{ matrix.language }}-queries/versions --jq '.[0].metadata.container.tags[0]' 2>/dev/null); then
# See the `queries` job above for why `|| true` is inside the substitution: a
123
-
# brand-new pack's GHCR container doesn't exist yet, so `gh api` 404s; without this,
124
-
# `bash -e` would abort here and block the pack's first-ever publish.
125
-
PUBLISHED_VERSION=$(gh api /orgs/githubsecuritylab/packages/container/codeql-${{ matrix.language }}-libs/versions --jq '.[0].metadata.container.tags[0]' 2>/dev/null || true)
137
+
# See the `queries` job above for why PUBLISHED_VERSION is forced empty on any
138
+
# `gh api` failure instead of relying on `|| true`.
139
+
if ! PUBLISHED_VERSION=$(gh api /orgs/githubsecuritylab/packages/container/codeql-${{ matrix.language }}-libs/versions --jq '.[0].metadata.container.tags[0]' 2>/dev/null); then
# See the `queries` job above for why `|| true` is inside the substitution: a
205
-
# brand-new pack's GHCR container doesn't exist yet, so `gh api` 404s; without this,
206
-
# `bash -e` would abort here and block the pack's first-ever publish.
207
-
PUBLISHED_VERSION=$(gh api /orgs/githubsecuritylab/packages/container/codeql-${{ matrix.language }}-extensions/versions --jq '.[0].metadata.container.tags[0]' 2>/dev/null || true)
224
+
# See the `queries` job above for why PUBLISHED_VERSION is forced empty on any
225
+
# `gh api` failure instead of relying on `|| true`.
226
+
if ! PUBLISHED_VERSION=$(gh api /orgs/githubsecuritylab/packages/container/codeql-${{ matrix.language }}-extensions/versions --jq '.[0].metadata.container.tags[0]' 2>/dev/null); then
# See the `queries` job above for why `|| true` is inside the substitution: a
292
-
# brand-new pack's GHCR container doesn't exist yet, so `gh api` 404s; without this,
293
-
# `bash -e` would abort here and block the pack's first-ever publish.
294
-
PUBLISHED_VERSION=$(gh api /orgs/githubsecuritylab/packages/container/codeql-${{ matrix.language }}-library-sources/versions --jq '.[0].metadata.container.tags[0]' 2>/dev/null || true)
316
+
# See the `queries` job above for why PUBLISHED_VERSION is forced empty on any
317
+
# `gh api` failure instead of relying on `|| true`.
318
+
if ! PUBLISHED_VERSION=$(gh api /orgs/githubsecuritylab/packages/container/codeql-${{ matrix.language }}-library-sources/versions --jq '.[0].metadata.container.tags[0]' 2>/dev/null); then
0 commit comments