Skip to content

Fail local-testing check rather than add nag comment #6098

Fail local-testing check rather than add nag comment

Fail local-testing check rather than add nag comment #6098

name: Request Local Testing approval if necessary
on:
pull_request:
types: [review_requested, review_request_removed, opened, synchronize]
branches:
- main
jobs:
request_review:
if: ${{!contains(toJSON(github.event.pull_request.requested_teams), 'local-testing')}}
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check for local-testing changes
id: check-diff
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
url: ${{ github.event.pull_request.html_url }}
run: |
if gh pr diff "$url" | grep "^+" | grep "local_testing_mode"; then echo "Seems like your changes contain some Local Testing changes, please request review from @snowflakedb/local-testing"; exit 1; else echo "PR does not seem to contain Local Testing changes"; fi