summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Kubacki <michael.kubacki@microsoft.com>2024-05-28 15:10:11 -0400
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-05-29 00:40:36 +0000
commit55f8bddade205c9cbe3583d5d31d0048cdf26ed4 (patch)
tree211d8c39f8a05e70e93bff2a02c9cd52f9ef107a
parent0e3189d406684e44608e01c93f7e2d53fa07b40a (diff)
downloadedk2-55f8bddade205c9cbe3583d5d31d0048cdf26ed4.zip
edk2-55f8bddade205c9cbe3583d5d31d0048cdf26ed4.tar.gz
edk2-55f8bddade205c9cbe3583d5d31d0048cdf26ed4.tar.bz2
.github: Add PR template
Adds a pull request template with important information to note in the PR description and guidance on how to classify the PR. A simple GitHub action is present that applies three labels based on the boxes checked in the PR template: - `impact:breaking-change` - `impact:security` - `impact:testing` These provide several purposes. 1. Bring attention to the impact of the PR both for reviewers and consumers that reference the PR in the future during debug or integration. 2. Allow automated tools like those that create release notes to be able to highlight important changes. 3. Similarly, to allow PR searches to conditionalize the search on PRs with these tags present. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
-rw-r--r--.github/pull_request_template.md27
-rw-r--r--.github/workflows/pr-labeler.yml36
-rw-r--r--.github/workflows/pr-labeler/regex.yml16
3 files changed, 79 insertions, 0 deletions
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
new file mode 100644
index 0000000..70e8c56
--- /dev/null
+++ b/.github/pull_request_template.md
@@ -0,0 +1,27 @@
+# Description
+
+<_Include a description of the change and why this change was made._>
+
+<_For each item, place an "x" in between `[` and `]` if true. Example: `[x]` (you can also check items in GitHub UI)_>
+
+<_Create the PR as a Draft PR if it is only created to run CI checks._>
+
+<_Delete lines in \<\> tags before creating the PR._>
+
+- [ ] Breaking change?
+ - **Breaking change** - Will this cause a break in build or boot behavior?
+ - Examples: Add a new library class or move a module to a different repo.
+- [ ] Impacts security?
+ - **Security** - Does the change have a direct security impact?
+ - Examples: Crypto algorithm change or buffer overflow fix.
+- [ ] Includes tests?
+ - **Tests** - Does the change include any explicit test code?
+ - Examples: Unit tests or integration tests.
+
+## How This Was Tested
+
+<_Describe the test(s) that were run to verify the changes._>
+
+## Integration Instructions
+
+<_Describe how these changes should be integrated. Use N/A if nothing is required._>
diff --git a/.github/workflows/pr-labeler.yml b/.github/workflows/pr-labeler.yml
new file mode 100644
index 0000000..1b7daa6
--- /dev/null
+++ b/.github/workflows/pr-labeler.yml
@@ -0,0 +1,36 @@
+# This workflow automatically applies labels to pull requests based on regular expression matches against the content
+# in the pull request.
+#
+# Copyright (c) Microsoft Corporation.
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+# For more information, see:
+# https://github.com/github/issue-labeler
+
+name: Apply Labels Based on Message Content
+
+on:
+ pull_request_target:
+ types:
+ - edited
+ - opened
+ - reopened
+ - synchronize
+ workflow_dispatch:
+
+jobs:
+ sync:
+ name: Label PR from Description
+ runs-on: ubuntu-latest
+
+ permissions:
+ contents: read
+ pull-requests: write
+
+ steps:
+ - name: Apply Labels Based on PR Description
+ uses: github/issue-labeler@v3.1
+ with:
+ configuration-path: .github/workflows/pr-labeler/regex.yml
+ enable-versioned-regex: 0
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/pr-labeler/regex.yml b/.github/workflows/pr-labeler/regex.yml
new file mode 100644
index 0000000..b14746d
--- /dev/null
+++ b/.github/workflows/pr-labeler/regex.yml
@@ -0,0 +1,16 @@
+# Specifies labels to apply to pull requests based on regular expressions.
+#
+# Copyright (c) Microsoft Corporation.
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+# For more information, see:
+# https://github.com/github/issue-labeler
+
+impact:breaking-change:
+ - '\s*-\s*\[\s*[x|X]\s*\] Breaking change\?'
+
+impact:security:
+ - '\s*-\s*\[\s*[x|X]\s*\] Impacts security\?'
+
+impact:testing:
+ - '\s*-\s*\[\s*[x|X]\s*\] Includes tests\?'