-
Notifications
You must be signed in to change notification settings - Fork 1.9k
37 lines (35 loc) · 1.44 KB
/
check-ai-review-approval.yml
File metadata and controls
37 lines (35 loc) · 1.44 KB
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
28
29
30
31
32
33
34
35
36
37
name: AI Review Approval verification
on:
pull_request:
types: [opened, synchronize, labeled, unlabeled]
permissions:
contents: read
jobs:
check_ai_review_approval_job:
runs-on: ubuntu-latest
# Skip for fork PRs since we do not want to allow secrets access.
if: github.repository == 'demisto/content' && github.event.pull_request.head.repo.fork != true
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10" # The Python version set here is the minimum supported by content, if you change it here, please change all the places containing this comment.
- name: Setup Poetry
uses: Gr1N/setup-poetry@48b0f77c8c1b1b19cb962f0f00dff7b4be8f81ec # v9
- name: Install python dependencies
run: |
poetry install --with github-actions
- name: set pythonpath
run: |
echo "PYTHONPATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV
- name: Check if AI review is approved
id: check_approval
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
GITHUB_TOKEN: ${{ secrets.MARKETPLACE_AI_REVIEWER_GITHUB_TOKEN }}
run: |
echo "Checking AI Review Approval for PR: $PR_NUMBER"
cd .github/github_workflow_scripts
poetry run python check_ai_review_approval.py --pr_number $PR_NUMBER --github_token $GITHUB_TOKEN