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 -*-

manifest:
  version: 1.0

automations:
  approve_javascript_log_output:
    # Triggered for JavaScript changes that only affect the console.log() method
    if: 
      - {{ files | match(regex=r/\.js$|\.ts$/) | every }}
      - {{ source.diff.files | matchDiffLines(regex=r/^[+-].*console\.log/, ignoreWhiteSpaces=true) | every }}
    run: 
      - action: add-label@v1
        args:
          label: 'log-output-only'
      - action: approve@v1
      - action: add-comment@v1
        args:
          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.