Skip to content

GPU Test Cleanup

GPU Test Cleanup #16

name: GPU Test Cleanup
# Remove the "GPU CI" label after GPU tests complete
# This requires maintainers to explicitly re-add the label for each test run
on:
workflow_run:
workflows: ["GPU Test"]
types: [completed]
jobs:
remove-label:
name: Remove GPU CI Label
runs-on: ubuntu-latest
# Only run if there's an associated PR
if: github.event.workflow_run.event == 'pull_request'
steps:
- name: Remove GPU CI label
uses: actions/github-script@v7
with:
script: |
// Get the PR number from the workflow run
const prNumber = context.payload.workflow_run.pull_requests[0]?.number;
if (!prNumber) {
console.log('No PR number found, skipping label removal');
return;
}
try {
await github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
name: 'GPU CI'
});
console.log(`Removed "GPU CI" label from PR #${prNumber}`);
} catch (error) {
// Label might already be removed or not exist
if (error.status === 404) {
console.log('Label not found, may have already been removed');
} else {
throw error;
}
}