Change Missing Lambda Field
If a PR creates a new Lambda function, but lacks a description field, gitStream will request changes and post a comment that explains why.
Conditions (all must be true):
- The PR contains an update to a Lambda function.
- The affected files are missing a description field.
Automation Actions:
- Add a
lambda-missing-field
label to the PR. - Request changes and post a comment that explains why.
Change Missing Lambda Field
# -*- mode: yaml -*-
manifest:
version: 1.0
automations:
# Request changes when required Lambda information is missing from the PR.
catch_missing_lambda_info:
# Triggered for new Lambda functions that are missing a description field.
if:
- {{ source.diff.files | matchDiffLines(regex=r/LambdaFunction/) | some }}
- {{ source.diff.files | matchDiffLines(regex=r/description:/) | nope }}
# Apply the lambda-missing-field label and request changes to the PR.
run:
- action: add-label@v1
args:
label: 'lambda-missing-field'
color: '#FF0000'
- action: request-changes@v1
args:
comment: |
New `LambdaFunction` must have `description:` field.