Skip to content

Comments

Link to first compilation issue line in GitHub Actions#19

Merged
yaito3014 merged 13 commits intomainfrom
claude/fix-action-step-links-4VbQO
Feb 18, 2026
Merged

Link to first compilation issue line in GitHub Actions#19
yaito3014 merged 13 commits intomainfrom
claude/fix-action-step-links-4VbQO

Conversation

@yaito3014
Copy link
Member

Summary

Updated the GitHub Actions job link generation to point directly to the first line where a compilation warning or error occurs, rather than always linking to line 1.

Key Changes

  • Added logic to parse compilation output and find the line number of the first warning or error
  • Extract the line number from the compilation output by splitting into lines and using findIndex() to locate the first occurrence of a warning or error pattern
  • Updated the GitHub Actions job URL to use the calculated firstIssueLine instead of hardcoded 1

Implementation Details

  • When a warning is detected, the code searches for the first line matching the warning pattern and stores its line number
  • When an error is detected, the code searches for the first line matching the error pattern and stores its line number
  • The line number is 1-indexed to match GitHub's line numbering convention (array index + 1)
  • Falls back to line 1 if no match is found (defensive programming with idx !== -1 check)

https://claude.ai/code/session_01Eph17CQCfdnKaJhA2nSr9W

The generated GitHub Actions step links always used #step:N:1, pointing
to the first line of the step. Now the link points to the line where the
first warning (or error) actually occurred in the compilation output.

https://claude.ai/code/session_01Eph17CQCfdnKaJhA2nSr9W
@yaito3014 yaito3014 temporarily deployed to CppWarningNotifier February 18, 2026 05:27 — with GitHub Actions Inactive
@cppwarningnotifier

This comment has been minimized.

The build step was using >> to redirect all output to compilation.log,
hiding it from the step log. Since step links now point to the specific
warning line, the output must be visible in the step log. Using tee
sends output to both the file and stdout.

https://claude.ai/code/session_01Eph17CQCfdnKaJhA2nSr9W
@yaito3014 yaito3014 temporarily deployed to CppWarningNotifier February 18, 2026 05:32 — with GitHub Actions Inactive
@cppwarningnotifier

This comment has been minimized.

Each regex was duplicated: once for the whole-string check and once for
findIndex. Now we just do findIndex directly — if it finds a match,
we know both the result and the line number in one pass.

https://claude.ai/code/session_01Eph17CQCfdnKaJhA2nSr9W
@yaito3014 yaito3014 temporarily deployed to CppWarningNotifier February 18, 2026 05:37 — with GitHub Actions Inactive
@cppwarningnotifier

This comment has been minimized.

@yaito3014 yaito3014 temporarily deployed to CppWarningNotifier February 18, 2026 05:50 — with GitHub Actions Inactive
@cppwarningnotifier

This comment has been minimized.

Add console.log statements to trace warning/error detection (total lines,
matched index, matched content, final result). Apply a +3 line offset to
firstIssueLine to account for GitHub Actions preamble lines in step logs.

https://claude.ai/code/session_01Eph17CQCfdnKaJhA2nSr9W
@yaito3014 yaito3014 temporarily deployed to CppWarningNotifier February 18, 2026 05:56 — with GitHub Actions Inactive
@cppwarningnotifier

This comment has been minimized.

@yaito3014 yaito3014 temporarily deployed to CppWarningNotifier February 18, 2026 06:48 — with GitHub Actions Inactive
@cppwarningnotifier

This comment has been minimized.

@yaito3014 yaito3014 temporarily deployed to CppWarningNotifier February 18, 2026 06:57 — with GitHub Actions Inactive
@cppwarningnotifier
Copy link

@yaito3014 yaito3014 merged commit ad464ff into main Feb 18, 2026
13 checks passed
@yaito3014 yaito3014 deleted the claude/fix-action-step-links-4VbQO branch February 18, 2026 06:59
@yaito3014
Copy link
Member Author

fixed #17

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.

2 participants