-
Notifications
You must be signed in to change notification settings - Fork 459
32 lines (26 loc) · 1.39 KB
/
backport-verification.yml
File metadata and controls
32 lines (26 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# 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.
# 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
# If the "##Backport" section is missing, the workflow will fail and block the PR from merging, prompting the developer to add this section.
# The workflow is configured to run when PR is created as well as when it is edited which also counts simple description edits.
name: "NGO - Backport Verification"
on:
pull_request:
types: [opened, edited, synchronize, reopened]
branches:
- develop
- develop-2.0.0
jobs:
backport-verification:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check PR description
uses: actions/github-script@v7
with:
script: |
const pr = context.payload.pull_request;
const body = pr.body || '';
if (!body.includes('## Backport')) {
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.');
}