Skip to content

ci: reject invalid symlink targets - #372

Merged
theletterf merged 1 commit into
mainfrom
ci/check-symlink-integrity
Sep 25, 2026
Merged

theletterf merged 1 commit into
mainfrom
ci/check-symlink-integrity

Conversation

@theletterf

@theletterf theletterf commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

PR #368 briefly broke elastic/docs-actions@v1 because a formatter appended a newline to the Git blob for docs-builder/preview/cleanup/scripts/retry.js. Git accepted the blob as a mode 120000 symlink, but GitHub Actions could not resolve the resulting target name.

This PR adds a repository-level symlink integrity check to the existing pre-commit validation path. The checker reads mode 120000 entries from the Git index and inspects their blob bytes directly. It rejects empty targets and targets that contain NUL, CR, or LF bytes.

The check does not depend on the filesystem representation. It still works when core.symlinks=false causes Git to materialize symlinks as regular text files. The hook uses always_run, so the existing pre-commit CI workflow runs it for every pull request without adding another workflow.

Validation:

This is the merge-time backstop. A separate PR makes make lint non-mutating so the same class of problem is also prevented during local and agent validation.

Related to #404

@theletterf
theletterf requested a review from a team as a code owner September 24, 2026 19:11
@theletterf
theletterf requested a review from technige September 24, 2026 19:11
@theletterf theletterf self-assigned this Sep 24, 2026
@theletterf theletterf added the enhancement New feature or request label Sep 24, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved — I found no actionable issues in this change.


What is this? | From workflow: PR Review

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

@theletterf
theletterf merged commit a76abf5 into main Sep 25, 2026
14 of 17 checks passed
@theletterf
theletterf deleted the ci/check-symlink-integrity branch September 25, 2026 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants