forked from hmarr/auto-approve-action
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: update information about inputs
- Loading branch information
Showing
4 changed files
with
291 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Self Test | ||
on: [pull_request] | ||
|
||
jobs: | ||
self-action-test: | ||
name: This GitHub Action Test | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Test Local Action | ||
if: github.actor == 'tsinis' || github.actor == 'dependabot[bot]' | ||
uses: ./ | ||
with: | ||
add-label: true | ||
case-sensitive: true | ||
fallback-to-ask: true | ||
require-brackets: true | ||
review-message: "Auto approved Ship or Ask PRs (from Dependabot/Author)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Auto Approve GitHub Action | ||
# Ship/Show/Ask GitHub Action | ||
|
||
[![CI](https://github.com/tsinis/ship-show-ask/actions/workflows/ci.yml/badge.svg?event=push)](https://github.com/tsinis/ship-show-ask/actions/workflows/ci.yml) | ||
|
||
|
@@ -8,7 +8,7 @@ This is a fork of the [Auto Approve](https://github.com/marketplace/actions/auto | |
|
||
## Usage instructions | ||
|
||
Create a workflow file (e.g. `.github/workflows/auto-approve.yml`) that contains a step that `uses: tsinis/[email protected]`. Here's an example workflow file: | ||
Create a workflow file (e.g. `.github/workflows/ship-show-ask.yml`) that contains a step that `uses: tsinis/[email protected]`. Here's an example workflow file: | ||
|
||
```yaml | ||
name: Auto approve Ship/Show PRs | ||
|
@@ -21,16 +21,43 @@ jobs: | |
pull-requests: write | ||
steps: | ||
- uses: tsinis/[email protected] | ||
with: | ||
ship-keyword: 'lgtm' # optional, default to 'ship' | ||
show-keyword: 'lgty' # optional, default to 'show' | ||
ask-keyword: 'check' # optional, default to 'ask' | ||
case-sensitive: true # optional, default to false | ||
add-label: false # optional, default to true | ||
require-brackets: false # optional, default to true | ||
fallback-to-ask: true # optional, default to false | ||
``` | ||
Combine with an `if` clause to only auto-approve certain users. For example, to auto-approve [Dependabot][dependabot] pull requests, use: | ||
In this example, the action is configured to recognize 'lgtm', 'lgty', and 'check' as the keywords for the respective strategies. The keywords are case-sensitive, a label will not be added to the pull request based on the strategy, the keywords doesn't require brackets, and if no keyword is detected, the action will fallback to the Ask strategy. | ||
You can customize these options by changing the values in the `with` block. | ||
|
||
> [!TIP] | ||
> All of these inputs are optional, and if not provided, the action will use the default values. | ||
|
||
### Inputs | ||
|
||
- `ship-keyword`: The keyword for the Ship strategy. Default is 'ship'. | ||
- `show-keyword`: The keyword for the Show strategy. Default is 'show'. | ||
- `ask-keyword`: The keyword for the Ask strategy. Default is 'ask'. | ||
- `case-sensitive`: Whether the keywords are case-sensitive. Default is 'false'. | ||
- `add-label`: Whether to add a label to the pull request based on the strategy. Default is 'true'. | ||
- `require-brackets`: Whether the keywords require brackets. Default is 'true'. | ||
- `fallback-to-ask`: Whether to fallback to the Ask strategy if no keyword is detected. Default is 'false'. | ||
|
||
### Other examples | ||
|
||
You can combine action with an `if` clause to only ship-show-ask certain users. For example, to ship-show-ask [Dependabot][dependabot] pull requests, use: | ||
|
||
```yaml | ||
name: Ship/Show Dependabot PRs | ||
on: pull_request_target | ||
jobs: | ||
auto-approve: | ||
ship-show-ask: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write | ||
|
@@ -48,11 +75,11 @@ on: | |
workflow_dispatch: | ||
inputs: | ||
pullRequestNumber: | ||
description: Pull request number to auto-approve | ||
description: Pull request number for ship-show-ask | ||
required: false | ||
jobs: | ||
auto-approve: | ||
ship-show-ask: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write | ||
|
@@ -69,7 +96,7 @@ name: Ship/Show Dependabot PRs with a message | |
on: pull_request_target | ||
jobs: | ||
auto-approve: | ||
ship-show-ask: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write | ||
|
@@ -91,7 +118,7 @@ name: Auto approve Ship/Show PRs | |
on: pull_request_target | ||
jobs: | ||
auto-approve: | ||
ship-show-ask: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: tsinis/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.