Skip to content

Commit

Permalink
workflow_dispatch: allow specifying ref
Browse files Browse the repository at this point in the history
  • Loading branch information
dhimmel committed Aug 25, 2021
1 parent 3f2d84f commit dbecc62
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/manubot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@ on:
- master
workflow_dispatch:
inputs:
ref:
description: Git reference (branch, commit, tag) to build
default: main
BUILD_PDF:
description: generate PDF output
description: Build PDF output
default: "true"
BUILD_DOCX:
description: generate DOCX output
description: Build DOCX output
default: "false"
BUILD_LATEX:
description: generate LaTeX output
description: Build LaTeX output
default: "false"
jobs:
manubot:
Expand All @@ -31,11 +34,15 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v2
with:
# when there is no ref input (not a workflow_dispatch) should use default ref behavior
ref: ${{ github.event.inputs.ref }}
# fetch entire commit history to support get_rootstock_commit
fetch-depth: 0
- name: Set Environment Variables (Workflow Dispatch)
if: github.event_name == 'workflow_dispatch'
run: |
# overwriting GITHUB_SHA might be dangerous
echo "GITHUB_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV
echo "BUILD_PDF=${{ github.event.inputs.BUILD_PDF }}" >> $GITHUB_ENV
echo "BUILD_DOCX=${{ github.event.inputs.BUILD_DOCX }}" >> $GITHUB_ENV
echo "BUILD_LATEX=${{ github.event.inputs.BUILD_LATEX }}" >> $GITHUB_ENV
Expand Down

0 comments on commit dbecc62

Please sign in to comment.