travelperk / label-requires-reviews-action Goto Github PK
View Code? Open in Web Editor NEWThis Github action will require a minimum number of reviews if a label is present
License: MIT License
This Github action will require a minimum number of reviews if a label is present
License: MIT License
I have installed the action in accordance with the README.md, such that I have 3 labels:
label a
requires 0 reviews
label b
requires 1 reviews
label c
requires 2 reviews
Steps to reproduce the unexpected behavior:
b
label (such that 1 review is required)pull_request
) fails (expectedly, since there are no reviews) and I cannot mergepull_request_review
) succeeds (due to the approval) but the previous pull_request
check is still present and failed and I still cannot mergeIs it possible to fix this (without manually re-running the checks)?
.github/workflows/label-reviews.yml
# This workflow will set a number or reviewers depending on the labels
name: Label Reviews
# Trigger the workflow on pull requests
on:
pull_request:
types:
- opened
- reopened
- synchronize
- labeled
- unlabeled
pull_request_review:
types:
- submitted
- edited
- dismissed
jobs:
require-reviewers:
# Optional: skip check if no relevant label is present
# This needs to be kept in sync with the labels being checked
runs-on: ubuntu-latest
steps:
- name: Require-reviewers
uses: travelperk/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
rules_yaml: | # define which PR labels require how many aprroving reviewers
a: 0
b: 1
c: 2
One of the main use cases for this action is updating then reviews for an existing PR are posted. Currently the PR info can't be retrieved on the entrypoint code and the workflow is failing when this happens.
I have a scenario wherein branch usage prevents the branch protection rule "Require pull request reviews before merging". However, the check is still needed on pull requests going into the branch mentioned.
ie:
In the above, feature/some-feature is to merge into epic/some-epic but, epic branch rules do not and cannot enforce "Require pull request reviews before merging" as this prevents developers from updating epic branches with "master" without a PR.
In addition to this, the check does not dismiss outdated reviews which is desirable but, not possible without the PR requirement rule.
So, can functionality be added such that:
As mentioned on #1 there is still a lack of test for the main entrypoint workflow.
We've noticed that the same reviewer approving, re-requesting review and approving again counts as two approves.
This could be avoided in the code.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.