Skip to content

Commit 9d34a84

Browse files
authored
add a manual workflow trigger where a one-off diff can be requested (#175)
1 parent 45e9f57 commit 9d34a84

File tree

2 files changed

+46
-2
lines changed

2 files changed

+46
-2
lines changed

.github/workflows/manual.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: manual
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
diffbase:
7+
description: the version or commit to diff against
8+
required: false
9+
type: string
10+
11+
env:
12+
REGISTRY: ghcr.io
13+
IMAGE_NAME: ${{ github.repository }}
14+
15+
jobs:
16+
# Use the latest container to render the samples with the given diff
17+
render-samples:
18+
needs: build-container
19+
uses: ./.github/workflows/render.yml
20+
with:
21+
container-version: latest
22+
input: guide.tcg
23+
workflow: pr
24+
render-samples:
25+
needs: build-container
26+
uses: ./.github/workflows/render.yml
27+
with:
28+
container-version: latest
29+
input: guide.tcg
30+
workflow: pr
31+
manual_diffbase: ${{ inputs.diffbase }}

.github/workflows/render.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,13 @@ on:
2020
required: true
2121
type: string
2222
workflow:
23-
description: the workflow to run ('pr', 'push', 'release')
23+
description: the workflow to run ('pr', 'push', 'release', 'manual')
2424
required: true
2525
type: string
26+
manual_diffbase:
27+
description: diffbase for manual workflow
28+
required: false
29+
type: string
2630

2731
jobs:
2832
render:
@@ -77,9 +81,18 @@ jobs:
7781
diffbase: "${{ github.event.pull_request.base.sha }}"
7882
pr-number: "${{ github.event.number }}"
7983
pr-repo: "${{ github.repository }}"
84+
# Render the document with diffs in the 'manual' mode.
85+
- name: Render
86+
if: inputs.workflow == 'manual'
87+
uses: ./.github/actions/render
88+
with:
89+
input-md: ${{ inputs.input }}
90+
output-basename: ${{ steps.gen_output_name.outputs.OUTPUT_FILENAME }}
91+
pdf: true
92+
diffbase: "${{ inputs.manual_diffbase }}"
8093
# Render the document without diffs in other modes.
8194
- name: Render
82-
if: inputs.workflow != 'pr'
95+
if: inputs.workflow != 'pr' && inputs.workflow != 'manual'
8396
uses: ./.github/actions/render
8497
with:
8598
input-md: ${{ inputs.input }}

0 commit comments

Comments
 (0)