-
Notifications
You must be signed in to change notification settings - Fork 3
45 lines (40 loc) · 1.38 KB
/
gpu-test-cleanup.yml
File metadata and controls
45 lines (40 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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;
}
}