Skip to content

Commit c1f4796

Browse files
authored
Add on-demand execution on windows (#9138)
Test should execute on `main` branch or in PRs if `/windows-test` is added in comments.
1 parent a85d57a commit c1f4796

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: windows-test command dispatch
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
windows-test-command-trigger:
12+
permissions:
13+
pull-requests: write # for peter-evans/slash-command-dispatch to create PR reaction
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Trigger windows-test command
18+
uses: peter-evans/slash-command-dispatch@13bc09769d122a64f75aa5037256f6f2d78be8c4 # v4.0.0
19+
with:
20+
token: ${{ secrets.WINDOWS_WORKERS_TOKEN }}
21+
# The command to trigger the pipeline: e.g. /windows-test
22+
# The command name must match the name of the repository_dispatch.type in 'ci-windows.yml' workflow, using '-command' as suffix. E.g. 'windows-test-command'
23+
commands: windows-test
24+
issue-type: pull-request
25+
# The user that owns the above token must belong to the elevated role of 'Maintainers'
26+
permission: maintain
27+
reactions: false

.github/workflows/ci-windows.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ on:
3232
- 'README.md'
3333
- 'RELEASING.md'
3434
- '.sdkmanrc'
35+
repository_dispatch:
36+
types: [windows-test-command]
3537

3638
concurrency:
3739
group: "${{ github.workflow }}-${{ github.head_ref || github.sha }}"
@@ -42,7 +44,7 @@ permissions:
4244

4345
jobs:
4446
core:
45-
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
47+
if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event.client_payload.slash_command.command == 'windows-test' }}
4648
runs-on: self-hosted
4749
permissions:
4850
checks: write

0 commit comments

Comments
 (0)