Skip to content

Commit e72de07

Browse files
committed
fix watermark_branch
1 parent ed5bb99 commit e72de07

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/preview.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ module.exports.register = function () {
1818
const args = {
1919
repo: process.env.PREVIEW_REPO,
2020
branch: process.env.PREVIEW_BRANCH || 'HEAD',
21+
// watermark branch allows us to masquerade as a different branch
22+
// this is useful for previewing a PR against the main branch e.g.
23+
// so that the watermark lines don't trigger in the diff.
2124
watermark_branch: process.env.PREVIEW_WATERMARK_BRANCH,
2225
config: process.env.PREVIEW_CONFIG || process.env.PREVIEW_BRANCH || 'HEAD',
2326
remote: process.env.PREVIEW_REMOTE ? true : false,
@@ -136,7 +139,7 @@ module.exports.register = function () {
136139
playbook.content.sources = mappedSources
137140

138141
const date = new Date().toISOString().split('T')[0]
139-
const watermark_branch = args.watermark || args.branch
142+
const watermark_branch = args.watermark_branch || args.branch
140143
playbook.asciidoc.attributes['page-watermark'] =
141144
`${date} ${args.repo} ${watermark_branch}`
142145

0 commit comments

Comments
 (0)