Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

ci: add workflow_dispatch path to ci-fast for testing workflow changes

Steven Enamakel3d0cae6854f5
diff --git a/.github/workflows/ci-fast.yml b/.github/workflows/ci-fast.yml
index 5fd72bc5f2..86e2f1c354 100644
--- a/.github/workflows/ci-fast.yml
+++ b/.github/workflows/ci-fast.yml
@@ -17,6 +17,12 @@ on:
pull_request_target:
branches: [main, release]
types: [opened, synchronize, reopened, ready_for_review]
+ # Testing workflow changes before they merge: dispatch this file from a
+ # branch of THIS repository (`gh workflow run ci-fast.yml --ref <branch>`).
+ # EX63 only admits it while that branch's ci-fast.yml and ci-lanes.yml are
+ # on the runner group's allowlist, which is temporary; only the dispatching
+ # actor's membership is checked, since there is no PR author.
+ workflow_dispatch:
permissions:
actions: read
@@ -24,7 +30,7 @@ permissions:
pull-requests: read
concurrency:
- group: ci-fast-${{ github.event.pull_request.number }}
+ group: ci-fast-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
@@ -62,6 +68,12 @@ jobs:
[ "${login}" = "${AUTHOR}" ] && { [ "${ASSOCIATION}" = "OWNER" ] || [ "${ASSOCIATION}" = "MEMBER" ]; }
}
member=false
+ if [ "${GITHUB_EVENT_NAME}" = "workflow_dispatch" ]; then
+ # Only someone with write access can dispatch; still require the
+ # dispatcher to be a member.
+ AUTHOR="${ACTOR}"
+ ASSOCIATION="$([ -n "${MEMBERSHIP_TOKEN}" ] && echo NONE || echo MEMBER)"
+ fi
if is_member "${AUTHOR}" && is_member "${ACTOR}"; then
member=true
fi
@@ -75,5 +87,6 @@ jobs:
uses: ./.github/workflows/ci-lanes.yml
with:
profile: ex63
- pr-number: ${{ github.event.pull_request.number }}
- base-ref: ${{ github.base_ref }}
+ pr-number: ${{ github.event.pull_request.number || 0 }}
+ base-ref: ${{ github.base_ref || 'main' }}
+ ref: ${{ github.event_name == 'workflow_dispatch' && github.sha || '' }}
diff --git a/.github/workflows/ci-lanes.yml b/.github/workflows/ci-lanes.yml
index 70d9e0272c..1fbfa205b8 100644
--- a/.github/workflows/ci-lanes.yml
+++ b/.github/workflows/ci-lanes.yml
@@ -27,7 +27,14 @@ on:
required: true
pr-number:
type: number
- required: true
+ required: false
+ default: 0
+ # A trusted branch ref to check out instead of the PR merge commit: the
+ # manual `workflow_dispatch` test path of ci-fast.yml. Empty for PRs.
+ ref:
+ type: string
+ required: false
+ default: ""
base-ref:
type: string
required: true
@@ -56,7 +63,7 @@ jobs:
- name: Checkout PR merge commit
uses: tinyhumansai/.github/actions/checkout@35fa65b76c80d48779592b111837e55d9d0860d4
with:
- ref: refs/pull/${{ inputs.pr-number }}/merge
+ ref: ${{ inputs.ref != '' && inputs.ref || format('refs/pull/{0}/merge', inputs.pr-number) }}
fetch-depth: 0
submodules: recursive
# Pin ancestry checks also inspect compile-only vendor repositories.