Skip to content

Link to the step number the marker carries - #33

Closed
yaito3014 wants to merge 2 commits into
mainfrom
feat/step-from-marker
Closed

yaito3014 wants to merge 2 commits into
mainfrom
feat/step-from-marker

Conversation

@yaito3014

@yaito3014 yaito3014 commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Links each result to the step number printed after the marker, instead of the first step whose name matches STEP_REGEX, so other steps can be named freely (see the review on iris-cpp/iris#120). The step looks up its own number while it runs, as the job's only in_progress step; this needs actions: read and GH_TOKEN:

echo "CPPWARNINGNOTIFIER_LOG_MARKER $(gh api "repos/$GITHUB_REPOSITORY/actions/jobs/${{ job.check_run_id }}" --jq '.steps[] | select(.status == "in_progress") | .number')"

STEP_REGEX becomes an optional fallback, and now links by step number rather than list position, since numbers can skip values. The TEST workflow uses the numbered marker without STEP_REGEX.

Stacked on #32. Verified with unit tests, and with probe runs on a fork (plain and reusable-workflow jobs, ubuntu and windows) that reported the correct step number. Not tested: the notifier end to end, as CI only runs for PRs into main; fork PRs; self-hosted runners without gh. The 5 tsc --noEmit errors and the rollup TS5110 warning are pre-existing.

The link to a job's result pointed at the first successful step whose
name matched STEP_REGEX, so a workflow could not name another step
like its build step without taking the link away from it. A step can
instead print its own number after the marker, looked up from the jobs
API while it runs, when the step is the only one in_progress:

  echo "CPPWARNINGNOTIFIER_LOG_MARKER $(gh api \
    "repos/$GITHUB_REPOSITORY/actions/jobs/${{ job.check_run_id }}" \
    --jq '.steps[] | select(.status == "in_progress") | .number')"

which needs actions: read and GH_TOKEN in the job. STEP_REGEX becomes
optional and is used only when the marker carries no number of a step
of the job, and a step it matches is now linked by its number rather
than by its position in the list, as step numbers can skip values.
The notifier's own CI now links through the numbered marker, without
STEP_REGEX.
@yaito3014
yaito3014 force-pushed the feat/step-from-marker branch from 9f51f03 to 1f92264 Compare November 19, 2026 06:25
@yaito3014
yaito3014 changed the base branch from fix/scan-after-marker to main November 19, 2026 06:25
@yaito3014 yaito3014 closed this Nov 19, 2026
@yaito3014 yaito3014 reopened this Nov 19, 2026
@cppwarningnotifier

Copy link
Copy Markdown
EnvironmentC++20C++23C++26
ubuntu24.04GNU13Debug⚠️warning⚠️warning⚠️warning
Release⚠️warning⚠️warning⚠️warning
LLVM20Debug⚠️warning⚠️warning⚠️warning
Release⚠️warning⚠️warning⚠️warning

Updated at 2026-11-19 06:28:07 UTC for commit 1f92264

@yaito3014

Copy link
Copy Markdown
Member Author

Reading the step number back from the API inside the job gave wrong links, because the API lags.
GHA gives no other way to identify a step except by its name, so the link has to depend on the step name, at best an exact one. :(

@yaito3014 yaito3014 closed this Nov 19, 2026
@yaito3014
yaito3014 deleted the feat/step-from-marker branch November 19, 2026 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant