-
Notifications
You must be signed in to change notification settings - Fork 146
27 lines (25 loc) · 946 Bytes
/
enforce_localtest.yml
File metadata and controls
27 lines (25 loc) · 946 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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