A small utility action that automatically adds a bot review in the presence of a selected label.
Create a new .github/workflows/approve-by-label.yml
file:
name: approve-by-label
on:
pull_request:
types: [labeled, unlabeled]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v1
- uses: EmbarkStudios/action-auto-review-by-label
with:
github-token: ${{ secrets.BOT_TOKEN }}
bot-username: thefuntastic
label-name: skip-review
The following options are required:
github-token
: Personal access token for the account performing reviews. Note that the built-in github actions token does not have permission for review approval, so a new token must be generated. For details on generating a new token, see the offical guide.bot-username
: Username of the account associated with the token - is used to detect existing reviews. Will result in review approval spam if misconfigured.label-name
: Name of the label intended to trigger auto-approval.
Removing the chosen label doesn't remove the review from the PR. This is because once github records a positive review, dismissing it only converts it back to a pending review.
A pending review can interfere with merge rules that require all approvals to be green. So instead we leave the review in place, requiring human users to manually intervene if necessary.
We welcome community contributions to this project.
Please read our Contributor Guide for more information on how to get started. Please also read our Contributor Terms before you make any contributions.
Any contribution intentionally submitted for inclusion in an Embark Studios project, shall comply with the Rust standard licensing model (MIT OR Apache 2.0) and therefore be dual licensed as described below, without any additional terms or conditions:
This contribution is dual licensed under EITHER OF
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
For clarity, "your" refers to Embark or any other licensee/user of the contribution.