From 976d69d84f08b44a94911df406ef5374aae886eb Mon Sep 17 00:00:00 2001 From: Chris Fenner Date: Tue, 10 Sep 2024 20:23:33 -0700 Subject: [PATCH] use pandoc action from pandoc repo instead of local path (#180) * 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 --- .github/actions/render/action.yml | 5 +++++ .github/workflows/render.yml | 11 ++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/actions/render/action.yml b/.github/actions/render/action.yml index 1ff34c5..2e1d9a5 100644 --- a/.github/actions/render/action.yml +++ b/.github/actions/render/action.yml @@ -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: diff --git a/.github/workflows/render.yml b/.github/workflows/render.yml index 7545290..e443477 100644 --- a/.github/workflows/render.yml +++ b/.github/workflows/render.yml @@ -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 }} @@ -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 }} @@ -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 }}