summaryrefslogtreecommitdiff
path: root/.github/workflows/request-reviews.yml
diff options
context:
space:
mode:
authorMichael Kubacki <michael.kubacki@microsoft.com>2024-08-01 02:04:06 +0300
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-08-05 22:30:26 +0300
commit32a099c358b3d4b093f76b2d060bcb3154ac5c56 (patch)
treee2fb46fb7a20b93e820e3c7e373d40cbdf557854 /.github/workflows/request-reviews.yml
parentf617b6ee0eb81853b50fd50ea71dd1b2ceb9b9a5 (diff)
downloadedk2-32a099c358b3d4b093f76b2d060bcb3154ac5c56.tar.xz
.github/request-reviews.yml: Improve doc and dbg messages
Adds additional documentation and cleans up debug messages printed to GitHub workflow output (available in the GitHub Actions pane). Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Diffstat (limited to '.github/workflows/request-reviews.yml')
-rw-r--r--.github/workflows/request-reviews.yml5
1 files changed, 5 insertions, 0 deletions
diff --git a/.github/workflows/request-reviews.yml b/.github/workflows/request-reviews.yml
index 9b0d126649..bd00dd4516 100644
--- a/.github/workflows/request-reviews.yml
+++ b/.github/workflows/request-reviews.yml
@@ -74,14 +74,17 @@ jobs:
WORKSPACE_PATH = os.environ['WORKSPACE_PATH']
GET_MAINTAINER_LOCAL_PATH = os.path.join(WORKSPACE_PATH, os.environ['GET_MAINTAINER_REL_PATH'])
+ # Step 1: Get the GitHub created PR commit SHA (contains all changes in a single commit)
pr_commit_sha = GitHub.get_pr_sha(os.environ['GH_TOKEN'], os.environ['ORG_NAME'], os.environ['REPO_NAME'], int(os.environ['PR_NUMBER']))
if not pr_commit_sha:
sys.exit(1)
print(f"::notice title=PR Commit SHA::Looking at files in consolidated PR commit: {pr_commit_sha}")
+ # Step 2: Fetch only the PR commit to get the files changed in the PR
git.Repo(WORKSPACE_PATH).remotes.origin.fetch(pr_commit_sha, depth=1)
+ # Step 3: Get the list of reviewers for the PR
reviewers = GitHub.get_reviewers_for_range(WORKSPACE_PATH, GET_MAINTAINER_LOCAL_PATH, pr_commit_sha, pr_commit_sha)
if not reviewers:
print("::notice title=No New Reviewers Found!::No reviewers found for this PR.")
@@ -92,6 +95,8 @@ jobs:
f"PR {os.environ['PR_NUMBER']}: {', '.join(reviewers)}"
)
+ # Step 4: Add the reviewers to the PR
+ # Note the final requested reviewer list in the workflow run for reference
new_reviewers = GitHub.add_reviewers_to_pr(
os.environ["GH_TOKEN"],
os.environ["ORG_NAME"],