Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a manual workflow trigger where a one-off diff can be requested #175

Merged
merged 1 commit into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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