Markdown link check fails in a local repository without a Git remote

Open Beginner friendly
#20 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
81/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
github-actions, javascript

Research direction

Read the markdown-links job in .github/workflows/ci.yml and the local commands in docs/development.md; reproduce the failure in a staged Git repository with no remote. Check how the link checker accepts repository: false and whether relative links and heading anchors still work in that mode. Done when local checks pass without an origin and same-repository URL checks remain enabled when one is configured.

Written by the indexing model from the issue text.

Description

good first issue type/ci
Kind

A job fails, but the change is correct

Job

.github/workflows/ci.yml, job markdown-links.
The failure affects the local command in docs/development.md.

Problem

The documented Markdown link check stops before it checks any links when the local Git repository has no remote. It should check relative file links and heading anchors without a remote.

To reproduce:

  1. Copy the template files, without .git, into a new directory.
  2. Run git init and stage the files. Do not add a remote.
  3. Run both link check commands in the CI section of docs/development.md.
Run

Reported from a local run. No GitHub Actions run is linked.

Log

remark-validate-links 13.1.0 throws this error when its remote lookup finds no origin:

Cannot find remote `origin` of local Git repo; pass `repository: false` if you are not using Git
Proposal

Use repository: false for the local check when origin is absent. Keep checks for relative file links and heading anchors in that mode. Preserve checks for full URLs that point to the same repository when origin is configured.

Dominant language
Shell
Stars
1
Forks
0
Avg merge
6h 59m
Merged PRs (30d)
26

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from c-w-z/commit-decision-record

All issues in c-w-z/commit-decision-record

Similar issues

More Shell/Bash issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.