-
Notifications
You must be signed in to change notification settings - Fork 920
Expand file tree
/
Copy pathtime-sfmbal-benchmark-trigger.yml
More file actions
37 lines (33 loc) · 1.07 KB
/
time-sfmbal-benchmark-trigger.yml
File metadata and controls
37 lines (33 loc) · 1.07 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
name: Trigger timeSFMBAL Benchmark
on:
issue_comment:
types: [created]
permissions:
actions: write
contents: read
pull-requests: read
jobs:
dispatch:
if: github.event.issue.pull_request != null
runs-on: ubuntu-latest
steps:
- name: Dispatch benchmark workflow for /bench
uses: actions/github-script@v7
with:
script: |
const body = context.payload.comment.body.trim();
if (body !== "/bench") {
core.info("Skipping dispatch: comment is not /bench.");
return;
}
const prNumber = context.payload.issue.number;
await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: "time-sfmbal-benchmark.yml",
ref: context.payload.repository.default_branch,
inputs: {
pr_number: String(prNumber),
},
});
core.info(`Dispatched time-sfmbal-benchmark.yml for PR #${prNumber}.`);