Skip to content

Commit 53eaab3

Browse files
PLT-1569: Add draft PR filter for pull request workflow (#1696)
## 🎫 Ticket https://jira.cms.gov/browse/PLT-1569 ## 🛠 Changes Adds a flag that excludes draft PRs from the pull request workflow. ## ℹ️ Context We don't want to be deploying _every_ change we commit to pull requests in the repo. ## 🧪 Validation With this added, the pull request workflow does not run, as seen in this example: #1663
1 parent e1a1c03 commit 53eaab3

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.github/workflows/libs-pull-request.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ run-name: Libs-pull-request
33

44
on:
55
pull_request:
6+
types: [opened, reopened, synchronize, ready_for_review]
7+
paths:
8+
- 'libs/**'
9+
branches:
10+
- main
611

712
permissions:
813
contents: read
@@ -20,4 +25,4 @@ jobs:
2025
sonarqube:
2126
if: github.event.pull_request.draft == false
2227
uses: ./.github/workflows/libs-sonarqube.yml
23-
secrets: inherit
28+
secrets: inherit

.github/workflows/pull-request.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: pull request jobs
22

33
on:
44
pull_request:
5+
types: [opened, synchronize, reopened, ready_for_review]
56
paths-ignore:
67
- libs/**
78
- lambdas/**
@@ -15,18 +16,21 @@ jobs:
1516
uses: ./.github/workflows/unit-integration-test.yml
1617
secrets: inherit
1718
build-deploy-api:
19+
if: github.event.pull_request.draft == false
1820
uses: ./.github/workflows/build-deploy.yml
1921
with:
2022
environment: test
2123
module: api
2224
secrets: inherit
2325
build-deploy-worker:
26+
if: github.event.pull_request.draft == false
2427
uses: ./.github/workflows/build-deploy.yml
2528
with:
2629
environment: test
2730
module: worker
2831
secrets: inherit
2932
e2e-test:
33+
if: github.event.pull_request.draft == false
3034
needs: [build-deploy-api, build-deploy-worker]
3135
uses: ./.github/workflows/e2e-test.yml
3236
with:

0 commit comments

Comments
 (0)