Skip to content

Commit 1595ceb

Browse files
authored
Merge pull request #13744 from quarto-dev/fix/issue-10031
2 parents d7aaff7 + 7179a75 commit 1595ceb

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

news/changelog-1.9.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ All changes included in 1.9:
5858
- ([#13570](https://github.com/quarto-dev/quarto-cli/pull/13570)): Replace Twitter with Bluesky in default blog template and documentation examples. New blog projects now include Bluesky social links instead of Twitter.
5959
- ([#13716](https://github.com/quarto-dev/quarto-cli/issues/13716)): Fix draft pages showing blank during preview when pre-render scripts are configured.
6060

61+
### `manuscript`
62+
63+
- ([#10031](https://github.com/quarto-dev/quarto-cli/issues/10031)): Fix manuscript rendering prompting for GitHub credentials when origin points to private repository. Auto-detection of manuscript URL now fails gracefully with a warning instead of blocking renders.
64+
6165
## `publish`
6266

6367
### Confluence

src/project/types/manuscript/manuscript.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ import {
8585
shouldMakeMecaBundle,
8686
} from "./manuscript-meca.ts";
8787
import { readLines } from "../../../deno_ral/io.ts";
88+
import { debug } from "../../../deno_ral/log.ts";
89+
import { logLevel, warnOnce } from "../../../core/log.ts";
8890
import {
8991
computeProjectArticleFile,
9092
isArticle,
@@ -366,8 +368,22 @@ export const manuscriptProjectType: ProjectType = {
366368
if (manuscriptConfig) {
367369
let baseUrl = manuscriptConfig[kManuscriptUrl];
368370
if (baseUrl === undefined) {
369-
const ghContext = await gitHubContext(options.project.dir);
370-
baseUrl = ghContext.siteUrl;
371+
try {
372+
const ghContext = await gitHubContext(options.project.dir);
373+
baseUrl = ghContext.siteUrl;
374+
} catch (e) {
375+
// git ls-remote failed (credentials, network, host key, etc.) - don't block rendering
376+
const errorMessage = e instanceof Error ? e.message : String(e);
377+
if (logLevel() === "DEBUG") {
378+
debug(`Failed to auto-detect manuscript URL from GitHub: ${errorMessage}`);
379+
}
380+
const debugHint = logLevel() === "DEBUG" ? '' : ' Run with --log-level debug for details.';
381+
warnOnce(
382+
'Unable to auto-detect manuscript URL from GitHub Pages. ' +
383+
'Set manuscript-url explicitly in your configuration if needed.' +
384+
debugHint
385+
);
386+
}
371387
}
372388
if (baseUrl) {
373389
filterParams[kManuscriptUrl] = baseUrl;

0 commit comments

Comments
 (0)