From 061e876c51b25708b2750a5e578729c2a5184e6b Mon Sep 17 00:00:00 2001 From: Dan Chao Date: Sat, 22 Nov 2025 10:16:30 -0800 Subject: [PATCH] Add workflow_dispatch trigger --- .github/index.pkl | 20 +++++++++++++++++++- .github/workflows/main.yml | 9 +++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/.github/index.pkl b/.github/index.pkl index 666aa7a08d..c74158b703 100644 --- a/.github/index.pkl +++ b/.github/index.pkl @@ -24,7 +24,18 @@ build = baseWorkflow prb = baseWorkflow -main = new { +main { + on { + workflow_dispatch { + inputs { + ["source_run"] { + type = "string" + required = false + description = "The source GitHub Action workflow run triggering this build" + } + } + } + } jobs { ["build-and-publish-docs"] = publishJob } @@ -69,6 +80,13 @@ local publishJob: Workflow.Job = new { contents = "write" } steps { + new { + name = "Triggered by" + `if` = "inputs.source_run != null" + run = """ + echo "Triggered by workflow in repo: ${{ inputs.source_run }}" >> $GITHUB_STEP_SUMMARY + """ + } new Common.Checkout { with { `fetch-depth` = 0 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 348f8dc203..96a6d9672e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,6 +8,12 @@ name: Build (main) - main tags-ignore: - '**' + workflow_dispatch: + inputs: + source_run: + description: The source GitHub Action workflow run triggering this build + required: false + type: string concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: false @@ -20,6 +26,9 @@ jobs: contents: write runs-on: ubuntu-latest steps: + - name: Triggered by + if: inputs.source_run != null + run: 'echo "Triggered by workflow in repo: ${{ inputs.source_run }}" >> $GITHUB_STEP_SUMMARY' - uses: actions/checkout@v5 with: fetch-depth: 0