Skip to content

Commit

Permalink
Update README.MD
Browse files Browse the repository at this point in the history
  • Loading branch information
aaimio authored Sep 4, 2021
1 parent 17523f8 commit d202c2c
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Capture a Vercel preview URL and feed it into your next GitHub action.

1. This action should run whenever an edit is made to a pull request comment (see [example](https://github.com/aaimio/vercel-preview-url-action#example) below).
- _If you wish to capture the preview URL on `push` or `pull_request` check out [zentered/vercel-preview-url](https://github.com/zentered/vercel-preview-url)_
- If you wish to capture the preview URL on `push` or `pull_request` check out [zentered/vercel-preview-url](https://github.com/zentered/vercel-preview-url)
2. It checks whether the editor of the comment is Vercel's bot account on GitHub.
3. It attempts to extract the preview URL from the comment and sets it as the action's output so that you can feed it into your next action.

Expand All @@ -12,18 +12,22 @@ Please note:
- This action only succeeds when a preview URL was found, it gets cancelled (if `GITHUB_TOKEN` is passed) or fails on every other event.
- This action will keep executing for every edit (if following `issue_comment.edited` trigger as per `example.yml`). When a new commit is pushed, Vercel may edit the comment again, triggering this action. Please ensure you're building in logic into your next action to handle this.

# Inputs
## Inputs

- `cancel_on_strings`: Cancel the action when any of these (comma separated) strings appear in the edited comment.
- `GITHUB_TOKEN`: Pass this (as `${{secrets.GITHUB_TOKEN}}`) to cancel actions instead of failing them.
- `preview_url_regexp`: Regular expression pattern (without delimiters) to capture the preview URL. Ensure first capture group captures the preview URL. (default: `Preview: \[(.*)\]`)
- `vercel_bot_name`: The name of the Vercel account commenting on pull requests. (default: `vercel[bot]`)
| Name | Description |
|----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `cancel_on_strings` | Cancel the action when any of these (comma separated) strings appear in the edited comment. |
| `GITHUB_TOKEN` | Pass this (as `${{secrets.GITHUB_TOKEN}}`) to cancel actions instead of failing them. |
| `preview_url_regexp` | Regular expression pattern (without delimiters) to capture the preview URL. Ensure first capture group captures the preview URL. (default: `Preview: \[(.*)\]`) |
| `vercel_bot_name` | The name of the Vercel account commenting on pull requests. (default: `vercel[bot]`) |

# Outputs
## Outputs

- `vercel_preview_url`: The preview URL which can be accessed through the [`steps` context](https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions#steps-context).
| Name | Description |
|----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `vercel_preview_url` | The preview URL which can be accessed through the [`steps` context](https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions#steps-context). |

# Example
## Example

The example below captures the Vercel preview URL and comments with it on the pull request.

Expand Down Expand Up @@ -57,6 +61,6 @@ jobs:
});
```
# Example usages
## Example use cases
- **Automated Lighthouse metrics to your PR with Vercel and GitHub Actions**: [OskarAhl/Lighthouse-github-action-comment](https://github.com/OskarAhl/Lighthouse-github-action-comment)

0 comments on commit d202c2c

Please sign in to comment.