-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (33 loc) · 983 Bytes
/
check-comments.yml
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
name: Validate PR Comment
on:
push:
issue_comment:
jobs:
validate:
#if: ${{ github.event.issue.pull_request }}
runs-on: ubuntu-latest
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJSON(github) }}
- run: |
echo "$GITHUB_CONTEXT"
echo ${{ github.event.issue.pull_request.headRefName }}
echo ${{ github.event.issue.pull_request.head.number }}
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.issue.pull_request.headRef }}
- name: 🐍 Setting Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'
- run: |
python -m pip install --upgrade pip
pip install -r .github/requirements.txt
python .github/validate_comment.py --body ${{ github.event.comment.body }}
if [ $? -ne 0 ]; then
echo "Validation failed!"
exit 1
fi