Review request action
evin/review-request@v1 keeps at most one open review request (a pull request,
merge request, change, or equivalent) in sync with a branch. It decides whether
the request should be created, refreshed, or closed, and runs configured shell
commands to do it. It has no built-in knowledge of any hosting provider.
It does not calculate versions, write changelogs, commit, tag, or push. Those belong to neighboring actions:
| Concern | Owner |
|---|---|
| Whether anything is releasable | evin/version-bumper@v1 changed output |
| Request body text | evin/changelog@v1 notes_path output file |
| Commit, tag, and publishing refs | evin/git-release@v1 push |
| Review request lifecycle | this action |
Configuration
Unknown fields are rejected.
with field | Type | Default | Contract |
|---|---|---|---|
branch | string | none | Required. Head branch the request tracks. |
base | string | none | Required. Branch the request targets. |
wanted | boolean | true | Whether a request should exist. Wire it to a producer such as ${release:bump.changed}. |
title | string | none | Required when wanted is true. Request title. |
body_path | string | none | Markdown file used as the request body. Must stay inside the workspace. |
commands | object | none | Shell commands described below. find is required. |
context | string map | {} | Extra values exposed to commands as EVIN_REVIEW_CONTEXT_<KEY> variables, for example a version or tag. |
String values pass through the task template context. In a dry run the
action plans the find command, marks the run unverified because the current
state of the request is unknown, and executes nothing.
Commands
Each command is a shell string run through ESH, like a run: step, in the
workspace root. Commands see only the task's declared environment plus the
variables below. Values reach commands through the environment, never through
string interpolation, so titles and bodies cannot inject shell syntax.
| Command | Required | Contract |
|---|---|---|
find | yes | Print the identifier of the open request for branch (the first non-empty line is used), or nothing when there is none. Exit non-zero only on failure. |
create | no | Create the request. When a request must be created and this is absent, the step fails. |
update | no | Refresh the title and body of the request in EVIN_REVIEW_ID. Absent means existing requests are left as they are (state none). |
close | no | Close the request in EVIN_REVIEW_ID. When a request must be closed and this is absent, the step fails. |
| Variable | Meaning |
|---|---|
EVIN_REVIEW_BRANCH | Head branch. |
EVIN_REVIEW_BASE | Base branch. |
EVIN_REVIEW_TITLE | Request title. |
EVIN_REVIEW_BODY_FILE | Absolute path to the body file, when body_path is set. |
EVIN_REVIEW_ID | Identifier returned by find; set for update and close. |
Outputs
| Output | Meaning |
|---|---|
state | created, updated, closed, or none. |
id | Identifier returned by find, when one exists. |
Example
The GitHub CLI is one possible backend; nothing in the action depends on it.
tasks:
propose:
stage: Publish
needs: [release:bump, release:changelog, release:prepare]
env: [GITHUB_TOKEN]
steps:
- uses: evin/review-request@v1
with:
branch: automation/release
base: main
wanted: ${release:bump.changed}
title: "chore(release): ${release:bump.tag}"
body_path: target/release-notes.md
commands:
find: gh pr list --head "$EVIN_REVIEW_BRANCH" --base "$EVIN_REVIEW_BASE" --state open --json number --jq '.[0].number // empty'
create: gh pr create --head "$EVIN_REVIEW_BRANCH" --base "$EVIN_REVIEW_BASE" --title "$EVIN_REVIEW_TITLE" --body-file "$EVIN_REVIEW_BODY_FILE"
update: gh pr edit "$EVIN_REVIEW_ID" --title "$EVIN_REVIEW_TITLE" --body-file "$EVIN_REVIEW_BODY_FILE"
close: gh pr close "$EVIN_REVIEW_ID" --delete-branch
Failure boundaries
Configuration analysis stays side-effect free: nothing runs until execution. A
non-zero exit from any command fails the step with its exit code and captured
stderr. Publishing the branch happens in an earlier step, so a failing command
leaves a pushed branch that the next run reconciles. The action never deletes
branches itself; removal belongs in close.
action.evin/review-request@v1 Keep one review request in sync with a branch.
Configure the request and the shell commands that manage it through with:.
action.evin/[email protected] Head branch the review request tracks.
Required. Accepts pipeline templates. Exposed to commands as EVIN_REVIEW_BRANCH.
action.evin/[email protected] Branch the review request targets.
Required. Exposed to commands as EVIN_REVIEW_BASE.
action.evin/[email protected] Whether a review request should exist.
Boolean or a template resolving to true or false; defaults to true. A wanted request is created or updated, an unwanted one is closed. title is required unless wanted is literally false.
action.evin/[email protected] Title of the review request.
Required when a request is wanted. Exposed to commands as EVIN_REVIEW_TITLE.
action.evin/[email protected]_path Markdown file used as the request body.
Must stay inside the workspace. Commands receive its absolute path as EVIN_REVIEW_BODY_FILE.
action.evin/[email protected] Shell commands that talk to the hosting provider.
Each command is an ESH string. Values reach commands through environment variables, never string interpolation. find is required.
action.evin/[email protected] Print the identifier of the open request, or nothing.
Required. The first non-empty stdout line becomes EVIN_REVIEW_ID and the id output. Exit non-zero only on failure.
action.evin/[email protected] Create the review request.
Runs when a request is wanted and none exists. The step fails if it is needed but not configured.
action.evin/[email protected] Refresh the title and body of the existing request.
Runs when a request is wanted and one exists. When absent, existing requests are left as they are.
action.evin/[email protected] Close the existing review request.
Runs when a request is not wanted and one exists. The step fails if it is needed but not configured. Branch removal belongs here.
action.evin/[email protected] Extra values exposed to commands.
Keys may contain letters, digits, and underscores and become EVIN_REVIEW_CONTEXT_<KEY> variables, upper-cased.