diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index efe4270525..ac429f8ae6 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -2,12 +2,10 @@ - - ## Changelog - Added: The package whose Changelog should be added to should be in the header. Delete the changelog section entirely if it's not needed. -- Fixed: If you update multiple packages, create a new section with a new header for the other package. +- Fixed: If you update multiple packages, create a new section with a new header for the other package. - Removed/Deprecated/Changed: Each bullet should be prefixed with Added, Fixed, Removed, Deprecated, or Changed to indicate where the entry should go. ## Testing and Documentation @@ -26,3 +24,13 @@ - [ ] Deprecation of the API is explained in the CHANGELOG. - [ ] The users can understand why this API was removed and what they should use instead. --> + +## Backport + + \ No newline at end of file diff --git a/.github/workflows/backport-verification.yml b/.github/workflows/backport-verification.yml new file mode 100644 index 0000000000..aaeb1aa739 --- /dev/null +++ b/.github/workflows/backport-verification.yml @@ -0,0 +1,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] + branches: + - develop + - develop-2.0.0 + +jobs: + backport-verification: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Check PR description + uses: actions/github-script@v6 + 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.'); + } \ No newline at end of file