1
- name : Dummy Workflow
1
+ name : Dummy PR Test Workflow
2
2
3
3
on :
4
4
pull_request :
5
- types : [opened, synchronize ] # Triggers when PR is created or updated
5
+ types : [opened] # Trigger only on PR creation
6
6
issue_comment :
7
- types : [created] # Triggered when a comment is created
8
- push :
9
- branches :
10
- - release/2* # Separate trigger for the release branch
7
+ types : [created] # Trigger on comment creation
11
8
12
9
jobs :
13
- dummy-job :
14
- if : >
15
- github.event_name != 'issue_comment' ||
16
- contains(github.event.comment.body, '/run-tests')
10
+ test :
17
11
runs-on : ubuntu-latest
18
-
19
12
concurrency :
20
- group : >
21
- ${{
22
- github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) ||
23
- github.event_name == 'issue_comment' && format('pr-{0}-comment', github.event.issue.number) ||
24
- github.ref
25
- }}
26
- cancel-in-progress : false # Don't cancel previous runs
13
+ group : ${{ github.event.pull_request.number || github.ref }} # Group by PR number or branch reference
14
+ cancel-in-progress : false # Don't cancel any in-progress runs
27
15
28
16
steps :
29
- - name : Print event details
30
- run : echo "Triggered ${{ github.event_name }}"
17
+ - name : Check if it's an issue comment with /run-tests
18
+ if : ${{ github.event_name == 'issue_comment' && contains(github.event.comment.body, '/run-tests') }}
19
+ run : echo "Tests are being triggered by a comment."
31
20
32
- - name : Simulate long test run
33
- run : sleep 120 # Simulate a long-running test
21
+ - name : Simulate test run
22
+ if : ${{ github.event_name == 'pull_request' || (github.event_name == 'issue_comment' && contains(github.event.comment.body, '/run-tests')) }}
23
+ run : |
24
+ echo "Test triggered by PR creation or /run-tests comment"
25
+ sleep 120 # Simulate a long-running test
0 commit comments