Commands
A command is a comment line that starts with the command at the first column, outside a code block. Case does not matter. Anything else on the line makes it a normal comment.
Send one command per comment. A comment with two commands runs neither. There is no way to name an app in the comment: the app is the one whose webhook received the event.
Turn it on
- UI
- CLI
- API
Open the app, then Previews, and use Pull request commands. A second switch allows commands on pull requests from forks and stays off unless you enable it.
Environment
What happens on a comment
- The webhook signature is verified with the same per-app secret as push deploys. An unsigned or wrongly signed delivery is rejected with 401.
- The kill switch and the app setting are checked. Off means the event is ignored.
- Only a newly created comment on a pull request counts. Edits, deletes and plain issues are ignored.
- Comments from bots, from GitHub Apps, and comments carrying Levelrail’s own reply marker are ignored.
- The comment id is recorded. A redelivered webhook, or an operator replay, finds it already handled and does nothing.
- The per-user and per-pull-request limits are applied before any call to GitHub.
- Levelrail asks GitHub for the commenter’s permission with the GitHub App token. Only
writeandadminpass. Any error, including a timeout or a 403, refuses the command. A commenter who fails this check gets no reply. - Levelrail reads the pull request from GitHub, not from the webhook body. It must be open, and its head repository must be the connected repository unless fork commands are on.
- The command runs through the same code as the dashboard and records the trigger as
pr_commentwith the GitHub login as the actor, on the deploy attempt where one is created and always on the app timeline. - One short comment is posted with the outcome.
Threat model
Secrets are never logged or echoed. Logs carry the app name, pull request number and GitHub login.
What it does not do
- It does not deploy the pull request’s code.
redeploydeploys the tracked branch. - It does not approve a deploy or override a freeze. Use the dashboard for those.
- It does not run for GitLab, Bitbucket or Gitea.
- It does not edit your repository’s webhooks.
- It does not accept a command from someone who only has read or triage access.