Skip to content

Commit a8da79e

Browse files
committed
Added backport-verification test
1 parent a7d6048 commit a8da79e

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# This workflow is designed to verify that the pull request description contains a "## Backport" section, which is important as a reminder to account for backports for anyone that works with NGO repository.
2+
# We have 2 development branches (develop and develop-2.0.0) and we need to ensure that relevant changes are landing in only one or both of them
3+
# If the "##Backport" section is missing, the workflow will fail and block the PR from merging, prompting the developer to add this section.
4+
5+
# The workflow is configured to run when PR is created as well as when it is edited which also counts simple description edits.
6+
7+
name: "NGO - Backport Verification"
8+
9+
on:
10+
pull_request:
11+
types: [opened, edited]
12+
branches:
13+
- develop
14+
- develop-2.0.0
15+
16+
jobs:
17+
backport-verification:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v3
22+
23+
- name: Check PR description
24+
uses: actions/github-script@v6
25+
with:
26+
script: |
27+
const pr = context.payload.pull_request;
28+
const body = pr.body || '';
29+
30+
if (!body.includes('## Backport')) {
31+
core.setFailed('PR description must include a "## Backport" section. Please add this section and provide information about this PR backport to develop or develop-2.0.0 branch respectively or explain why backport is not needed.');
32+
}

0 commit comments

Comments
 (0)