Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: gh action to apply PR review labels #5656

Merged

Conversation

matthewgallo
Copy link
Member

@matthewgallo matthewgallo commented Jul 9, 2024

Closes #5535

This action adds review labels to PRs (specifically the status: one more review label) to help us streamline our review process a bit.

Here is a rough summary of the steps taken:

  1. The received-pr-review.yml workflow is triggered when a review is submitted, either an approval or requested changes.
  2. This workflow saves the github.event data as a workflow artifact that is later used from process-pr-review-data.yml.
  3. When received-pr-review.yml completes, the process-pr-review-data.yml workflow will be dispatched and will make a request for the previously created workflow artifact.
  4. After unzipping the workflow artifact, we're now able to check if the reviewer is part of the reviewing team and count their review if it is an approval or skip it if it's not an approval.
  5. If the submitted review is from an account not part of the reviewing team then the review won't count at all.

What did you change?

.github/workflows/process-pr-review-data.yml
.github/workflows/received-pr-review.yml
.gitignore
actions/add-review-labels/.npmignore
actions/add-review-labels/Dockerfile
actions/add-review-labels/action.yml
actions/add-review-labels/index.js
actions/add-review-labels/package.json

How did you test and verify your work?

In test repo:
Successful process-pr-review-data workflow
Example PR with label applied

@matthewgallo matthewgallo requested review from elycheea, kennylam and a team as code owners July 9, 2024 18:15
Copy link

netlify bot commented Jul 9, 2024

Deploy Preview for carbon-for-ibm-products ready!

Name Link
🔨 Latest commit d9f73d9
🔍 Latest deploy log https://app.netlify.com/sites/carbon-for-ibm-products/deploys/66db2776cadbfe0008a60de2
😎 Deploy Preview https://deploy-preview-5656--carbon-for-ibm-products.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@matthewgallo matthewgallo requested a review from annawen1 July 9, 2024 18:15
annawen1
annawen1 previously approved these changes Aug 1, 2024
return;
}

if (approved.length >= 2) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t think we really need this step, unless there’s an operational reason we want to pull the label back off. But doesn’t really hurt either.

Copy link
Contributor

@davidmenendez davidmenendez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow this is terrific!

@elycheea elycheea added this pull request to the merge queue Sep 12, 2024
Merged via the queue into carbon-design-system:main with commit 7bbeaf5 Sep 12, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request]: create workflow to add review labels to PRs
4 participants