prcommand

package
v0.8.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package prcommand parses /levelrail commands out of a pull request comment.

Index

Constants

View Source
const Prefix = "/levelrail"

Prefix starts every command line.

Variables

View Source
var ErrMultiple = errors.New("prcommand: more than one command in the comment")

ErrMultiple means the comment holds more than one command line. Acting on one of several would be a guess, so none runs.

Functions

This section is empty.

Types

type Command

type Command string

Command is one accepted command.

const (
	Redeploy        Command = "redeploy"
	Rollback        Command = "rollback"
	Status          Command = "status"
	PreviewRedeploy Command = "preview redeploy"
)

The accepted commands. Nothing else parses.

func Parse

func Parse(body string) (Command, error)

Parse returns the single command in body, or "" when there is none. A command is a line that starts with the prefix at column zero, outside fenced code, with nothing after the verb. Quoted replies, indented code and prose mentions never match. Unknown verbs and trailing text are ignored.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL