Code Monkey home page Code Monkey logo

label-requires-reviews-action's Issues

Action creates two status checks - one passes, one fails.

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:

  1. I open a PR with some changes
  2. I add the b label (such that 1 review is required)
  3. the check (titled pull_request) fails (expectedly, since there are no reviews) and I cannot merge
  4. Someone else approves my PR
  5. A new check (titled pull_request_review) succeeds (due to the approval) but the previous pull_request check is still present and failed and I still cannot merge

image

Is it possible to fix this (without manually re-running the checks)?

Click to see my (very standard) configuration

.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

repository settings

image

Allow check to run without needing the enforce branch protection rules

image

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:

  • master
  • epic/some-epic
  • feature/some-feature

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:

  1. the branch protection rule is not required
  2. a mechanism to fake dismissal of outdated reviews (approvals)
  • ie: the approval count tracking approvals is reset if the approval timestamp is after the most recent commit

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.