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

https://github.com/open-turo/action-conditional-pr-comment

GitHub Action that supports instructing the author of a Pull Request (PR) how to resolve a given problem within the context of a PR. Conditionally adds a comment to the PR with resolution instructions, and once the condition is found to be resolved, allows the previously added comment, if one exists at that time, to be removed from the PR.
https://github.com/open-turo/action-conditional-pr-comment

action actions ci gha github

Last synced: 4 months ago
JSON representation

GitHub Action that supports instructing the author of a Pull Request (PR) how to resolve a given problem within the context of a PR. Conditionally adds a comment to the PR with resolution instructions, and once the condition is found to be resolved, allows the previously added comment, if one exists at that time, to be removed from the PR.

Awesome Lists containing this project

README

        

# action-conditional-pr-comment

[![Release](https://img.shields.io/github/v/release/open-turo/action-renovate)](https://github.com/open-turo/eslint-config-typescript/releases/)
[![Tests pass/fail](https://img.shields.io/github/actions/workflow/status/open-turo/action-renovate/ci.yaml)](https://github.com/open-turo/action-renovate/actions/)
[![License](https://img.shields.io/github/license/open-turo/action-renovate)](./LICENSE)
[![Contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg)](https://github.com/dwyl/esta/issues)
![CI](https://github.com/open-turo/action-renovate/actions/workflows/release.yaml/badge.svg)
[![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release)
[![Conventional commits](https://img.shields.io/badge/conventional%20commits-1.0.2-%23FE5196?logo=conventionalcommits&logoColor=white)](https://conventionalcommits.org)
[![Join us!](https://img.shields.io/badge/Turo-Join%20us%21-593CFB.svg)](https://turo.com/jobs)

## Description

GitHub Action that supports instructing the author of a Pull Request (PR) how to resolve a given problem within the context of a PR. Conditionally adds a comment to the PR with resolution instructions, and once the condition is found to be resolved, allows the previously added comment, if one exists at that time, to be removed from the PR.

## Usage

```yaml
- uses: open-turo/action-conditional-pr-comment@
with:
workflow:
# ADD indicates the comment is to be added/updated to/within the PR, REMOVE indicates the comment is to be removed from the PR.
#
# Required: true
# Default: ""

text-detector:
# This is some unique verbatim subset of the comment that is to be used to determine if a comment has already been created against the PR that instructs the author how to resolve the given problem.
#
# Required: true
# Default: created by action-conditional-pr-comment

github-token:
# GitHub token that can add/update/delete comments. e.g. 'secrets.GITHUB_TOKEN'
#
# Required: true
# Default: ""

comment:
# This is the full text of the message to be placed within a comment of the given PR to instruct the author of the PR how to resolve a given problem. This value should be provided for all ADD workflows.
#
# Required: false
# Default: fixme

comment-author:
# The author of the comment upon addition.
#
# Required: false
# Default: open-turo-bot

edit-mode:
# The mode when updating a comment, "replace" or "append".
#
# Required: false
# Default: append
```

## Inputs

| name | description | required | default |
| --- | --- | --- | --- |
| `workflow` |

ADD indicates the comment is to be added/updated to/within the PR, REMOVE indicates the comment is to be removed from the PR.

| `true` | `""` |
| `text-detector` |

This is some unique verbatim subset of the comment that is to be used to determine if a comment has already been created against the PR that instructs the author how to resolve the given problem.

| `true` | `created by action-conditional-pr-comment` |
| `github-token` |

GitHub token that can add/update/delete comments. e.g. 'secrets.GITHUB_TOKEN'

| `true` | `""` |
| `comment` |

This is the full text of the message to be placed within a comment of the given PR to instruct the author of the PR how to resolve a given problem. This value should be provided for all ADD workflows.

| `false` | `fixme` |
| `comment-author` |

The author of the comment upon addition.

| `false` | `open-turo-bot` |
| `edit-mode` |

The mode when updating a comment, "replace" or "append".

| `false` | `append` |

## Runs

This action is a `composite` action.

## Development

Install [pre-commit](https://pre-commit.com/) and the commit hooks:

```shell
pre-commit install
pre-commit install --hook-type commit-msg
```

## Get Help

Please review Issues, post new Issues against this repository as needed.

## Contributions

Please see [here](https://github.com/open-turo/contributions) for guidelines on
how to contribute to this project.