-
Notifications
You must be signed in to change notification settings - Fork 34
59 lines (49 loc) · 1.5 KB
/
pr-check.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: PR Check
on:
pull_request:
branches:
- main
permissions:
pull-requests: write
contents: read
jobs:
pr-check:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Configure pip for uvx
run: |
pip config set global.index-url https://uvx.org/pypi/simple/
pip config set global.trusted-host uvx.org
- name: Install dependencies
run: npm ci
- name: Run PR check script
run: npm run pr-check
env:
DEBUG: 'true'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }}
GITHUB_PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
- name: Provide feedback
if: always()
run: |
if [ ${{ job.status }} == 'success' ]; then
COMMENT="✅ PR validation passed successfully!"
else
COMMENT="❌ PR validation failed. Please check the workflow logs for details."
fi
gh pr comment ${{ github.event.pull_request.number }} --body "$COMMENT"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}