Skip to content

Commit

Permalink
use pandoc action from pandoc repo instead of local path (#180)
Browse files Browse the repository at this point in the history
* use pandoc action from pandoc repo instead of local path

* reference action by exact commit

* reference render by full filepath

* add note about commit hash of reusable action
  • Loading branch information
chrisfenner authored Sep 11, 2024
1 parent 8f79b56 commit 976d69d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .github/actions/render/action.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Reminder: Due to the way GitHub Actions treats reusable workflows that use reusable actions from local paths,
# we have to update .github/workflows/render.yml to point to a particular commit of this file.
# This means that when updating this file, we have to first send a PR that updates the action,
# then second send a PR send that uses the action in the reusable workflow.

name: 'Render'
description: 'Render a TCG Markdown document'
inputs:
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/render.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,15 @@ jobs:
key: latex-${{ inputs.input }}-${{ inputs.container-version }}-${{ github.run_id }}
restore-keys: latex-${{ inputs.input }}-${{ inputs.container-version }}

# Note: It appears that we can't pass variables into 'uses:' below to allow callers to
# request a version of the action. Referencing it by local path breaks external workflows
# that call to this one.
# The unfortunate workaround is for this file to be updated to point at specific commits
# and reference that version of the action file in this reusable workflow.
# Render the document with diffs in the 'pr' mode.
- name: Render
if: inputs.workflow == 'pr'
uses: ./.github/actions/render
uses: trustedcomputinggroup/pandoc/.github/actions/render@8f79b567c9dc6b15afba5d83d61e0d37f9508c47
with:
input-md: ${{ inputs.input }}
output-basename: ${{ steps.gen_output_name.outputs.OUTPUT_FILENAME }}
Expand All @@ -90,7 +95,7 @@ jobs:
# Render the document with diffs in the 'manual' mode.
- name: Render
if: inputs.workflow == 'manual'
uses: ./.github/actions/render
uses: trustedcomputinggroup/pandoc/.github/actions/render@8f79b567c9dc6b15afba5d83d61e0d37f9508c47
with:
input-md: ${{ inputs.input }}
output-basename: ${{ steps.gen_output_name.outputs.OUTPUT_FILENAME }}
Expand All @@ -99,7 +104,7 @@ jobs:
# Render the document without diffs in other modes.
- name: Render
if: inputs.workflow != 'pr' && inputs.workflow != 'manual'
uses: ./.github/actions/render
uses: trustedcomputinggroup/pandoc/.github/actions/render@8f79b567c9dc6b15afba5d83d61e0d37f9508c47
with:
input-md: ${{ inputs.input }}
output-basename: ${{ steps.gen_output_name.outputs.OUTPUT_FILENAME }}
Expand Down

0 comments on commit 976d69d

Please sign in to comment.