Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/micnncim/action-lgtm-reaction

GitHub Action to send LGTM reaction
https://github.com/micnncim/action-lgtm-reaction

actions github-actions lgtm lgtm-reaction

Last synced: 2 months ago
JSON representation

GitHub Action to send LGTM reaction

Awesome Lists containing this project

README

        

![logo](docs/assets/logo.png)

[![actions-workflow-CI][actions-workflow-CI-badge]][actions-workflow-CI]
[![actions-marketplace][actions-marketplace-badge]][actions-marketplace]
[![pkg.go.dev][pkg.go.dev-badge]][pkg.go.dev]
[![release][release-badge]][release]
[![license][license-badge]][license]

![](docs/assets/screen-record.gif)

Send LGTM reaction as image when we say `lgtm`.

Currently supports [LGTM.app](https://www.lgtm.app) and [GIPHY](https://giphy.com).

## Usage

### Create Workflow

#### `jobs..steps.env`

| Key | Value | Required |
| --------------- | ------------------------------ | ------------------------------------------------------ |
| `GITHUB_TOKEN` | `${{ secrets.GITHUB_TOKEN }}` | `true` |
| `GIPHY_API_KEY` | `${{ secrets.GIPHY_API_KEY }}` | `true` if `jobs..steps.with.source` == `giphy` |

#### `jobs..steps.with`

| Key | Default | Required | Note |
| ---------- | ------------------------------------ | -------- | ------------------------------------------------------------- |
| `trigger` | `'["^lgtm$", "^[gG]ood [jJ]ob!?$"]'` | `false` | Trigger comment body. It must be JSON string array of regexp. |
| `override` | `false` | `false` | Override posted comment body or not. |
| `source` | `lgtmapp` | `false` | `lgtmapp` or `giphy` |

#### Example

For minimalists:

```yaml
name: Send LGTM reaction
on:
issue_comment:
types: [created]
pull_request_review:
types: [submitted]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: micnncim/action-lgtm-reaction@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```

For nerds:

```yaml
name: Send LGTM reaction
on:
issue_comment:
types: [created]
pull_request_review:
types: [submitted]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: micnncim/action-lgtm-reaction@master # Set some version.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GIPHY_API_KEY: ${{ secrets.GIPHY_API_KEY }}
with:
trigger: '[".*looks good to me.*"]'
override: true
source: 'giphy'
```

### Setting GIPHY

The default image source is [LGTM.app](https://www.lgtm.app) but you can also configure [GIPHY](https://giphy.com).

1. Create your app and get API key from [here](https://developers.giphy.com/dashboard).
2. Set the API key in GitHub repository (Setting > Secret) as `GIPHY_API_KEY`.
3. Configure `'giphy'` in your GitHub Actions workflow.

## Projects using `action-lgtm-reaction`

- [Cake Website](https://github.com/cake-build/website)

## Note

*Icon made by Freepik from [www.flaticon.com](https://www.flaticon.com)*

[actions-workflow-CI]: https://github.com/micnncim/action-lgtm-reaction/actions?query=workflow%3ACI
[actions-workflow-CI-badge]: https://img.shields.io/github/workflow/status/micnncim/action-lgtm-reaction/CI?label=CI&style=for-the-badge&logo=github

[actions-marketplace]: https://github.com/marketplace/actions/lgtm-reaction
[actions-marketplace-badge]: https://img.shields.io/badge/marketplace-lgtm%20reaction-blue?style=for-the-badge&logo=github

[pkg.go.dev]: https://pkg.go.dev/github.com/micnncim/action-lgtm-reaction?tab=overview
[pkg.go.dev-badge]: https://img.shields.io/badge/pkg.go.dev-reference-02ABD7?style=for-the-badge&logoWidth=25&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ijg1IDU1IDEyMCAxMjAiPjxwYXRoIGZpbGw9IiMwMEFERDgiIGQ9Ik00MC4yIDEwMS4xYy0uNCAwLS41LS4yLS4zLS41bDIuMS0yLjdjLjItLjMuNy0uNSAxLjEtLjVoMzUuN2MuNCAwIC41LjMuMy42bC0xLjcgMi42Yy0uMi4zLS43LjYtMSAuNmwtMzYuMi0uMXptLTE1LjEgOS4yYy0uNCAwLS41LS4yLS4zLS41bDIuMS0yLjdjLjItLjMuNy0uNSAxL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2LjEtMTQuNiAyOC0xNi43IDEwLjItMS44IDE5LjgtLjggMjguNSA1LjEgNy45IDUuNCAxMi44IDEyLjcgMTQuMSAyMi4zIDEuNyAxMy41LTIuMiAyNC41LTExLjUgMzMuOS02LjYgNi43LTE0LjcgMTAuOS0yNCAxMi44LTIuNy41LTUuNC42LTggLjl6bTIzLjgtNDAuNGMtLjEtMS4zLS4xLTIuMy0uMy0zLjMtMS44LTkuOS0xMC45LTE1LjUtMjAuNC0xMy4zLTkuMyAyLjEtMTUuMyA4LTE3LjUgMTcuNC0xLjggNy44IDIgMTUuNyA5LjIgMTguOSA1LjUgMi40IDExIDIuMSAxNi4zLS42IDcuOS00LjEgMTIuMi0xMC41IDEyLjctMTkuMXoiLz48L3N2Zz4=

[release]: https://github.com/micnncim/action-lgtm-reaction/releases
[release-badge]: https://img.shields.io/github/v/release/micnncim/action-lgtm-reaction?style=for-the-badge&logo=github

[license]: LICENSE
[license-badge]: https://img.shields.io/github/license/micnncim/action-lgtm-reaction?style=for-the-badge