Skip to content

Commit 1c84371

Browse files
authored
ci: Allow manually dispatching the master Checks workflow (#828)
## Summary Adds `workflow_dispatch` to `CI (master)` so the `Checks` suite can be re-run manually on the same commit when the push-triggered run is lost — e.g. during a GitHub outage. The `doc_release` / `beta_release` jobs are gated on `github.event_name == 'push'` so manual dispatches only re-run the checks and never re-publish. The redundant `workflow_dispatch` trigger on `_checks.yaml` is removed: dispatching it directly produced check-run names without the `Checks /` prefix, so the `wait-for-checks` gate in the manual release workflows wouldn't recognize them anyway. Mirrors apify/crawlee-python#1917. ## How to use When a push-triggered Checks run on `master` is missing, go to **Actions → CI (master) → Run workflow** on `master`. Once it succeeds, the manual release workflows' `wait-for-checks` gate will be satisfied.
1 parent eddbb42 commit 1c84371

2 files changed

Lines changed: 26 additions & 20 deletions

File tree

.github/workflows/_checks.yaml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
11
name: Checks
22

33
on:
4-
# Runs when manually triggered from the GitHub UI.
5-
workflow_dispatch:
6-
inputs:
7-
run_tests:
8-
description: Whether to run the test suites (unit, integration).
9-
required: false
10-
type: boolean
11-
default: true
12-
13-
# Runs when invoked by another workflow.
4+
# Runs when invoked by another workflow. For manual runs, dispatch `CI (master)` instead — that wraps this
5+
# workflow via `uses:`, so the resulting check-run names get the `Checks /` prefix that the manual release
6+
# workflows look for via `wait-for-checks`.
147
workflow_call:
158
inputs:
169
run_tests:

.github/workflows/on_master.yaml

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ on:
77
tags-ignore:
88
- "**" # Ignore all tags to avoid duplicate executions triggered by tag pushes.
99

10+
# Allow re-running the Checks manually. Release jobs below are gated on `github.event_name == 'push'`
11+
# so they never fire on manual dispatch.
12+
workflow_dispatch:
13+
inputs:
14+
run_tests:
15+
description: Whether to run the test suites (unit, integration).
16+
required: false
17+
type: boolean
18+
default: true
19+
1020
permissions:
1121
contents: read
1222

@@ -15,13 +25,14 @@ jobs:
1525
name: Checks
1626
uses: ./.github/workflows/_checks.yaml
1727
with:
18-
# Skip the test suites for docs-only commits — they don't change runtime behavior.
19-
run_tests: ${{ !startsWith(github.event.head_commit.message, 'docs') }}
28+
# On push: skip the test suites for docs-only commits — they don't change runtime behavior.
29+
# On manual dispatch: honor the input.
30+
run_tests: ${{ github.event_name == 'push' && !startsWith(github.event.head_commit.message, 'docs') || github.event_name == 'workflow_dispatch' && inputs.run_tests }}
2031
secrets: inherit
2132

2233
doc_release:
23-
# Skip this for non-"docs" commits.
24-
if: startsWith(github.event.head_commit.message, 'docs')
34+
# Only on push, and only for "docs" commits.
35+
if: github.event_name == 'push' && startsWith(github.event.head_commit.message, 'docs')
2536
name: Doc release
2637
needs: [checks]
2738
permissions:
@@ -36,13 +47,15 @@ jobs:
3647
# because PyPI's Trusted Publishing does not currently support reusable workflows.
3748
# See: https://docs.pypi.org/trusted-publishers/troubleshooting/#reusable-workflows-on-github
3849
beta_release:
39-
# Run this only for "feat", "fix", "perf", "refactor" and "style" commits.
50+
# Only on push, and only for "feat", "fix", "perf", "refactor" and "style" commits.
4051
if: >-
41-
startsWith(github.event.head_commit.message, 'feat') ||
42-
startsWith(github.event.head_commit.message, 'fix') ||
43-
startsWith(github.event.head_commit.message, 'perf') ||
44-
startsWith(github.event.head_commit.message, 'refactor') ||
45-
startsWith(github.event.head_commit.message, 'style')
52+
github.event_name == 'push' && (
53+
startsWith(github.event.head_commit.message, 'feat') ||
54+
startsWith(github.event.head_commit.message, 'fix') ||
55+
startsWith(github.event.head_commit.message, 'perf') ||
56+
startsWith(github.event.head_commit.message, 'refactor') ||
57+
startsWith(github.event.head_commit.message, 'style')
58+
)
4659
name: Beta release
4760
needs: [checks]
4861
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)