Skip to content

Commit a6b889e

Browse files
ci: [Backport] backport-verification test (#3393)
## Backport This is a backport of #3385
1 parent 87e25ba commit a6b889e

File tree

2 files changed

+43
-3
lines changed

2 files changed

+43
-3
lines changed

.github/pull_request_template.md

+11-3
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22

33
<!-- Add short version of the JIRA ticket to the PR title (e.g. "feat: new shiny feature [MTT-123]") -->
44

5-
<!-- Add RFC link here if applicable. -->
6-
75
## Changelog
86

97
- Added: The package whose Changelog should be added to should be in the header. Delete the changelog section entirely if it's not needed.
10-
- Fixed: If you update multiple packages, create a new section with a new header for the other package.
8+
- Fixed: If you update multiple packages, create a new section with a new header for the other package.
119
- Removed/Deprecated/Changed: Each bullet should be prefixed with Added, Fixed, Removed, Deprecated, or Changed to indicate where the entry should go.
1210

1311
## Testing and Documentation
@@ -26,3 +24,13 @@
2624
- [ ] Deprecation of the API is explained in the CHANGELOG.
2725
- [ ] The users can understand why this API was removed and what they should use instead.
2826
-->
27+
28+
## Backport
29+
30+
<!-- If this is a backport:
31+
- Add the following to the PR title: "\[Backport\] ..." .
32+
- Link to the original PR.
33+
If this needs a backport - state this here
34+
If a backport is not needed please provide the reason why.
35+
If the "Backports" section is not present it will lead to a CI test failure.
36+
-->
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)