mirror of
https://github.com/lukaszraczylo/shared-actions.git
synced 2026-10-14 05:23:05 +00:00
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.
This commit is contained in:
@@ -64,7 +64,7 @@ on:
|
|||||||
type: string
|
type: string
|
||||||
default: "44"
|
default: "44"
|
||||||
release-workflow:
|
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
|
required: false
|
||||||
type: string
|
type: string
|
||||||
default: ""
|
default: ""
|
||||||
@@ -529,4 +529,9 @@ jobs:
|
|||||||
echo "Nothing was merged, so no release."
|
echo "Nothing was merged, so no release."
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
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
|
||||||
|
|||||||
@@ -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. |
|
| `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 |
|
| `minimum-release-age` | `2 days` | Skip releases younger than this |
|
||||||
| `renovate-version` | `44` | Renovate version |
|
| `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. |
|
| `admin-merge` | `false` | Merge with `--admin`. The workflow token cannot bypass branch protection. |
|
||||||
| `lfs` | `false` | Git LFS checkout |
|
| `lfs` | `false` | Git LFS checkout |
|
||||||
| `runner` | | Runner label or runner group, as in the other workflows |
|
| `runner` | | Runner label or runner group, as in the other workflows |
|
||||||
|
|||||||
Reference in New Issue
Block a user