Skip to content

Commit 26da789

Browse files
authored
Update PR comment workflow to use rendered book artifact
1 parent 48d66d7 commit 26da789

1 file changed

Lines changed: 5 additions & 13 deletions

File tree

.github/workflows/pr-comment.yml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,21 +44,13 @@ jobs:
4444
4545
const baseUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${runId}/artifacts`;
4646
47-
const pdfArtifact = artifacts.data.artifacts.find(
48-
a => a.name === `textbook-pdf-pr-${pr.number}`
47+
const artifact = artifacts.data.artifacts.find(
48+
a => a.name === `rendered-book-pr-${pr.number}`
4949
);
50-
const htmlArtifact = artifacts.data.artifacts.find(
51-
a => a.name === `textbook-html-pr-${pr.number}`
52-
);
53-
54-
const pdfLine = pdfArtifact
55-
? `📄 [Download PDF](${baseUrl}/${pdfArtifact.id})`
56-
: '📄 PDF artifact unavailable';
57-
const htmlLine = htmlArtifact
58-
? `🌐 [Download HTML](${baseUrl}/${htmlArtifact.id}) _(unzip and open \`index.html\` locally)_`
59-
: '🌐 HTML artifact unavailable';
6050
61-
const body = `📖 **Quarto render succeeded!**\n\n${pdfLine}\n${htmlLine}\n\n> _Updated on every push to this PR. Links expire after 14 days._`;
51+
const body = artifact
52+
? `📖 **Quarto render succeeded!**\n\n📦 [Download rendered book](${baseUrl}/${artifact.id}) _(contains HTML site + PDF; unzip and open \`index.html\` locally)_\n\n> _Updated on every push to this PR. Links expire after 14 days._`
53+
: `📖 **Quarto render succeeded!** (artifact unavailable)`;
6254
6355
const comments = await github.rest.issues.listComments({
6456
owner: context.repo.owner,

0 commit comments

Comments
 (0)