Skip to content

Approve JavaScript Log Output Changes

Approve changes to JavaScript files that only affect lines of code that invoke the console.log() method.

Conditions (all must be true):

  • All files must end in .js or .ts
  • The changes only affect lines of code that invoke console.log()

Automation Actions:

  • Applies a log-output-only label
  • Approves the PR
  • Posts a comment explaining that the change only affects logging output.

Approve JavaScript Log Output Changes

# -*- mode: yaml -*-

  version: 1.0

    # Triggered for JavaScript changes that only affect the console.log() method
      - {{ files | match(regex=r/\.js$|\.ts$/) | every }}
      - {{ source.diff.files | matchDiffLines(regex=r/^[+-].*console\.log/, ignoreWhiteSpaces=true) | every }}
      - action: add-label@v1
          label: 'log-output-only'
      - action: approve@v1
      - action: add-comment@v1
          comment: |
            This PR has been approved because it only contains changes to log output

Additional Resources

gitStream is a workflow automation tool that enables you to use YAML configuration files to optimize your code review process. Add context to PRs, find code experts for reviews, and automate the merge process to maximize developer productivity.

Learn More about how gitStream Works.

Related Automations:

More Automations can be found on the Automation Library and Integrations pages.