Skip to content

Commit 7d03df1

Browse files
RonnyPfannschmidtCursor AIComposer
committed
ci: gate downstream PR runs on branch name containing downstream
Replace the run-downstream label with a head branch filter so forks without shared labels still opt in (e.g. downstream-driver). Pull requests still target main only. Co-authored-by: Cursor AI <ai@cursor.sh> Co-authored-by: Composer <composer@cursor.com>
1 parent 085b2d1 commit 7d03df1

1 file changed

Lines changed: 6 additions & 13 deletions

File tree

.github/workflows/downstream.yml

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Downstream checks are opt-in on pull requests (label: run-downstream) or fully
2-
# manual via workflow_dispatch. For dispatch-only runs: Actions → downstream → Run
3-
# workflow → pick a branch under "Use workflow from".
1+
# Downstream checks run on pull requests to main when the head branch name
2+
# contains "downstream", or any time via workflow_dispatch. For dispatch-only
3+
# runs: Actions → downstream → Run workflow → pick a branch under "Use workflow from".
44
#
55
# The workflow must exist on the default branch for it to appear under the
66
# upstream repo's Actions tab; until the workflow is merged, use the fork's
@@ -10,7 +10,8 @@ name: downstream
1010
on:
1111
workflow_dispatch:
1212
pull_request:
13-
types: [labeled, synchronize]
13+
branches:
14+
- main
1415

1516
permissions: {}
1617

@@ -23,17 +24,9 @@ jobs:
2324
name: downstream (${{ matrix.recipe }})
2425
runs-on: ubuntu-latest
2526
timeout-minutes: 120
26-
# No default runs: add label "run-downstream" to the PR, or use workflow_dispatch.
2727
if: >-
2828
github.event_name == 'workflow_dispatch'
29-
|| (
30-
github.event_name == 'pull_request'
31-
&& contains(github.event.pull_request.labels.*.name, 'run-downstream')
32-
&& (
33-
github.event.action == 'synchronize'
34-
|| (github.event.action == 'labeled' && github.event.label.name == 'run-downstream')
35-
)
36-
)
29+
|| (github.event_name == 'pull_request' && contains(github.head_ref, 'downstream'))
3730
strategy:
3831
fail-fast: false
3932
matrix:

0 commit comments

Comments
 (0)