v0.2.4

Documentation version

v0.2.4v0.3.2
en

Documentation language

en

Search documentation

ESC

Documentation search

What are you working on?

Find a guide, configuration option, action, or ESH topic.

Browse documentation
DocsReview request action

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:

ConcernOwner
Whether anything is releasableevin/version-bumper@v1 changed output
Request body textevin/changelog@v1 notes_path output file
Commit, tag, and publishing refsevin/git-release@v1 push
Review request lifecyclethis action
mermaid
mermaid

yes, request exists

yes, none exists

no, request exists

no, none exists

run find

wanted?

run update

run create

run close

state none

Configuration

Unknown fields are rejected.

with fieldTypeDefaultContract
branchstringnoneRequired. Head branch the request tracks.
basestringnoneRequired. Branch the request targets.
wantedbooleantrueWhether a request should exist. Wire it to a producer such as ${release:bump.changed}.
titlestringnoneRequired when wanted is true. Request title.
body_pathstringnoneMarkdown file used as the request body. Must stay inside the workspace.
commandsobjectnoneShell commands described below. find is required.
contextstring 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.

CommandRequiredContract
findyesPrint 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.
createnoCreate the request. When a request must be created and this is absent, the step fails.
updatenoRefresh the title and body of the request in EVIN_REVIEW_ID. Absent means existing requests are left as they are (state none).
closenoClose the request in EVIN_REVIEW_ID. When a request must be closed and this is absent, the step fails.
VariableMeaning
EVIN_REVIEW_BRANCHHead branch.
EVIN_REVIEW_BASEBase branch.
EVIN_REVIEW_TITLERequest title.
EVIN_REVIEW_BODY_FILEAbsolute path to the body file, when body_path is set.
EVIN_REVIEW_IDIdentifier returned by find; set for update and close.

Outputs

OutputMeaning
statecreated, updated, closed, or none.
idIdentifier 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.

Page source: reference/actions/70.review-request-action.5160.md