-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce a new GitHub Action from the pandoc repo (#162)
* Introduce a new GitHub Action from the pandoc repo This change introduces an action called render that exists in the same repo as the rest of the Pandoc tools, so we can eventually retire the separate markdown repo (which hosted the action). * move the action file * rewrite boolean condition * add missing echo * use latest docker/login-action * use bool vars as bools * fix pdflog argument * only do pdfdiff if pdf is requested, also do diff * try removing quotes from diff_file_name * remove environment variable * move diff file naming into build script * tweak diff file name * fail if git can't reset * add git fetch unshallow * silence git fetch output * use quiet
- Loading branch information
1 parent
9d6f51c
commit 22f5386
Showing
4 changed files
with
101 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: 'Render' | ||
description: 'Render a TCG Markdown document' | ||
inputs: | ||
input-md: | ||
description: 'The name of the Markdown file to render' | ||
required: true | ||
output-basename: | ||
description: 'The base name (without extension) to use for output file(s)' | ||
required: true | ||
pr-repo: | ||
description: 'Pull request repo (use with pr-number)' | ||
required: false | ||
type: 'string' | ||
pr-number: | ||
description: 'Pull request number to reference (use with pr-repo)' | ||
required: false | ||
type: 'string' | ||
pdf: | ||
description: 'Render to PDF' | ||
required: false | ||
type: 'boolean' | ||
default: 'true' | ||
diffbase: | ||
description: 'The revision to diff against (use with pdf)' | ||
required: false | ||
type: 'string' | ||
html: | ||
description: 'Render to HTML' | ||
required: false | ||
type: 'boolean' | ||
default: 'false' | ||
docx: | ||
description: 'Render to Word' | ||
required: false | ||
type: 'boolean' | ||
default: 'false' | ||
tex: | ||
description: 'Render to TeX' | ||
required: false | ||
type: 'boolean' | ||
default: 'false' | ||
extra-build-options: | ||
description: 'Additional build options to be passed to build.sh' | ||
runs: | ||
using: 'composite' | ||
steps: | ||
# let the container take ownership of the repo dir, in case the user wants to check in the results | ||
# workaround to https://github.com/actions/runner/issues/2033 | ||
- run: chown -R $(id -u):$(id -g) $PWD | ||
shell: sh | ||
- run: > | ||
/usr/bin/build.sh | ||
--versioned_filenames | ||
$( [ -n "${{ inputs.pr-repo }}" -a -n "${{ inputs.pr-number }}" ] && echo --pr_number=${{ inputs.pr-number }} --pr_repo=${{ inputs.pr-repo }} ) | ||
$( [ ${{ inputs.pdf }} -a -n "${{ inputs.diffbase }}" ] && echo --diffbase=${{ inputs.diffbase }} --diffpdf=${{ inputs.output-basename }}.diff.pdf --diffpdflog=${{ inputs.output-basename }}.diff.pdf.log ) | ||
$( ${{ inputs.pdf }} && echo --pdf=${{ inputs.output-basename }}.pdf --pdflog=${{ inputs.output-basename }}.pdf.log ) | ||
$( ${{ inputs.html }} && echo --html=${{ inputs.output-basename }}.html ) | ||
$( ${{ inputs.docx }} && echo --docx=${{ inputs.output-basename }}.docx ) | ||
$( ${{ inputs.tex }} && echo --latex=${{ inputs.output-basename }}.tex ) | ||
${{ inputs.extra-build-options }} | ||
${{ inputs.input-md }} | ||
shell: sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters