[ci] Cancel fastcheck when PR is ready (#7433)

Signed-off-by: kevin <kevin@anyscale.com>
This commit is contained in:
Kevin H. Luu 2024-08-12 10:59:14 -07:00 committed by GitHub
parent 9b3e2edd30
commit 1137f343aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -6,17 +6,17 @@ on:
jobs:
cancel-buildkite-run:
if: github.event.label.name == 'invalid'
if: github.event.label.name == 'ready'
runs-on: ubuntu-latest
steps:
- name: Cancel Buildkite Run
- name: Cancel fastcheck run on Buildkite
env:
BUILDKITE_TOKEN: ${{ secrets.BUILDKITE_TOKEN }}
BUILDKITE_ORG: vllm
BUILDKITE_PIPELINE: fastcheck
run: |
echo "PR branch"
FULL_BRANCH=${{ github.event.pull_request.head.repo.owner.login }}:${{ github.event.pull_request.head.ref }}
echo "PR branch: $FULL_BRANCH"
LATEST_BUILD_NUMBER=$(curl -H "Authorization: Bearer $BUILDKITE_TOKEN" \
"https://api.buildkite.com/v2/organizations/$BUILDKITE_ORG/pipelines/$BUILDKITE_PIPELINE/builds?branch=$FULL_BRANCH&state[]=scheduled&state[]=running" \
| jq -r '.[0].number')