Skip to content

Commit

Permalink
add a manual workflow trigger where a one-off diff can be requested
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisfenner committed Sep 10, 2024
1 parent 45e9f57 commit 12ecced
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 2 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/manual.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: manual

on:
workflow_dispatch:
inputs:
diffbase:
description: the version or commit to diff against
required: false
type: string

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
# Use the latest container to render the samples with the given diff
render-samples:
needs: build-container
uses: ./.github/workflows/render.yml
with:
container-version: latest
input: guide.tcg
workflow: pr
render-samples:
needs: build-container
uses: ./.github/workflows/render.yml
with:
container-version: latest
input: guide.tcg
workflow: pr
manual_diffbase: ${{ inputs.diffbase }}
17 changes: 15 additions & 2 deletions .github/workflows/render.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,13 @@ on:
required: true
type: string
workflow:
description: the workflow to run ('pr', 'push', 'release')
description: the workflow to run ('pr', 'push', 'release', 'manual')
required: true
type: string
manual_diffbase:
description: diffbase for manual workflow
required: false
type: string

jobs:
render:
Expand Down Expand Up @@ -77,9 +81,18 @@ jobs:
diffbase: "${{ github.event.pull_request.base.sha }}"
pr-number: "${{ github.event.number }}"
pr-repo: "${{ github.repository }}"
# Render the document with diffs in the 'manual' mode.
- name: Render
if: inputs.workflow == 'manual'
uses: ./.github/actions/render
with:
input-md: ${{ inputs.input }}
output-basename: ${{ steps.gen_output_name.outputs.OUTPUT_FILENAME }}
pdf: true
diffbase: "${{ inputs.manual_diffbase }}"
# Render the document without diffs in other modes.
- name: Render
if: inputs.workflow != 'pr'
if: inputs.workflow != 'pr' && inputs.workflow != 'manual'
uses: ./.github/actions/render
with:
input-md: ${{ inputs.input }}
Expand Down

0 comments on commit 12ecced

Please sign in to comment.