From b06a5bb1b11d0196256af49ab8a7e8e4ff2b707a Mon Sep 17 00:00:00 2001 From: Lukasz Raczylo Date: Sat, 3 Oct 2026 21:04:20 +0100 Subject: [PATCH] feat(autoupdate): dispatch several workflows after a merge A repo can have more than one workflow that a push used to trigger, such as a Docker build and a site deploy. Let release-workflow take a comma-separated list and dispatch each one. --- .github/workflows/renovate-autoupdate.yaml | 9 +++++++-- README.md | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/renovate-autoupdate.yaml b/.github/workflows/renovate-autoupdate.yaml index c7cb369..64f568c 100644 --- a/.github/workflows/renovate-autoupdate.yaml +++ b/.github/workflows/renovate-autoupdate.yaml @@ -64,7 +64,7 @@ on: type: string default: "44" release-workflow: - description: "Workflow file to dispatch after a merge, for example release.yaml. It must have a workflow_dispatch trigger and the caller needs actions: write. Empty means no dispatch." + description: "Workflow file to dispatch after a merge, for example release.yaml. Give several as a comma-separated list. Each must have a workflow_dispatch trigger and the caller needs actions: write. Empty means no dispatch." required: false type: string default: "" @@ -529,4 +529,9 @@ jobs: echo "Nothing was merged, so no release." exit 0 fi - gh workflow run "$RELEASE_WORKFLOW" --repo "$GITHUB_REPOSITORY" --ref "$branch" + IFS=',' read -r -a workflows <<<"$RELEASE_WORKFLOW" + for workflow in "${workflows[@]}"; do + workflow=$(echo "$workflow" | xargs) + [ -n "$workflow" ] || continue + gh workflow run "$workflow" --repo "$GITHUB_REPOSITORY" --ref "$branch" + done diff --git a/README.md b/README.md index 4c2bdcf..a19c078 100644 --- a/README.md +++ b/README.md @@ -186,7 +186,7 @@ The workflow finds `go.mod` and `package.json` itself and tests what exists. A r | `major-updates` | `separate` | `separate`: each major gets its own branch, tested and merged on its own. `batch`: majors join the batch. `ignore`: skip majors. | | `minimum-release-age` | `2 days` | Skip releases younger than this | | `renovate-version` | `44` | Renovate version | -| `release-workflow` | | Workflow file to dispatch after a merge, for example `release.yaml`. It needs a `workflow_dispatch` trigger. Empty means no dispatch. | +| `release-workflow` | | Workflow file to dispatch after a merge, for example `release.yaml`. Give several as a comma-separated list. Each needs a `workflow_dispatch` trigger. Empty means no dispatch. | | `admin-merge` | `false` | Merge with `--admin`. The workflow token cannot bypass branch protection. | | `lfs` | `false` | Git LFS checkout | | `runner` | | Runner label or runner group, as in the other workflows |