Skip to content

Commit 82f5982

Browse files
authored
set workflow PR triggers to filter PR-types (invoke-ai#2065)
* set workflow PR triggers to filter PR-types - `review_requested` - `ready_for_review` * fail tests if draft pr * add more types to test pr triggers * remove unneeded condition * readd condition * leave PR-types default, only verify PRs to main and fail for draft-PRs * set types to cancel when converted to draft
1 parent 147834e commit 82f5982

2 files changed

Lines changed: 25 additions & 4 deletions

File tree

.github/workflows/test-invoke-conda.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,29 @@ on:
33
push:
44
branches:
55
- 'main'
6-
- 'development'
76
pull_request:
87
branches:
98
- 'main'
10-
- 'development'
9+
types:
10+
- 'ready_for_review'
11+
- 'opened'
12+
- 'synchronize'
13+
- 'converted_to_draft'
1114

1215
concurrency:
1316
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1417
cancel-in-progress: true
1518

1619
jobs:
20+
fail_if_pull_request_is_draft:
21+
if: github.event.pull_request.draft == true
22+
runs-on: ubuntu-22.04
23+
steps:
24+
- name: Fails in order to indicate that pull request needs to be marked as ready to review and unit tests workflow needs to pass.
25+
run: exit 1
26+
1727
matrix:
28+
if: github.event.pull_request.draft == false
1829
strategy:
1930
matrix:
2031
stable-diffusion-model:

.github/workflows/test-invoke-pip.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,28 @@ on:
33
push:
44
branches:
55
- 'main'
6-
- 'development'
76
pull_request:
87
branches:
98
- 'main'
10-
- 'development'
9+
types:
10+
- 'ready_for_review'
11+
- 'opened'
12+
- 'synchronize'
13+
- 'converted_to_draft'
1114

1215
concurrency:
1316
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1417
cancel-in-progress: true
1518

1619
jobs:
20+
fail_if_pull_request_is_draft:
21+
if: github.event.pull_request.draft == true
22+
runs-on: ubuntu-18.04
23+
steps:
24+
- name: Fails in order to indicate that pull request needs to be marked as ready to review and unit tests workflow needs to pass.
25+
run: exit 1
1726
matrix:
27+
if: github.event.pull_request.draft == false
1828
strategy:
1929
matrix:
2030
stable-diffusion-model:

0 commit comments

Comments
 (0)