Skip to content

Commit 88356f4

Browse files
authored
fix(running-in-ci): make commit-SHA permalink rule unmissable (#240)
1 parent 76debaf commit 88356f4

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

  • plugins/tend-ci-runner/skills/running-in-ci

plugins/tend-ci-runner/skills/running-in-ci/SKILL.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,17 +285,19 @@ gist without expanding. Don't collapse content that *is* the answer (e.g., a req
285285
</details>
286286
```
287287
288-
Always use markdown links for files, issues, PRs, and docs. Prefer permalinks (commit SHA URLs)
289-
over branch-based links for line references — line numbers shift and `blob/main/...#L42` links go
290-
stale.
288+
Always use markdown links for files, issues, PRs, and docs. **Any link containing `#L` must
289+
use a commit SHA, never `blob/main/...#L42`** — line numbers shift silently, so the link stays
290+
valid but starts pointing at different code than the comment describes. Get the SHA with
291+
`git rev-parse HEAD` before composing the link.
291292
292293
**GitHub URLs — always embed `$GITHUB_REPOSITORY`.** Construct links as
293294
`https://github.com/${GITHUB_REPOSITORY}/...`; never hand-type the owner. The model reliably
294295
guesses wrong — past comments have shipped with `anthropics/worktrunk` and `worktrunk/worktrunk`
295296
on a repo actually owned by `max-sixty`. Before posting a comment, scan it for `github.com/` and
296297
confirm every owner matches `$GITHUB_REPOSITORY`.
297298
298-
- **Files**: link to GitHub (`blob/main/...` for file-level, `blob/<sha>/...#L42` for lines)
299+
- **File-level link (no `#L` anchor)**: `blob/main/src/foo.rs` is fine
300+
- **Line reference**: `blob/<sha>/src/foo.rs#L42` — commit SHA required, never `blob/main/...#L42`
299301
- **Issues/PRs**: `#123` shorthand
300302
- **External**: `[text](url)` format
301303

0 commit comments

Comments
 (0)