forked from primefaces/primeng
-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (70 loc) · 2.97 KB
/
pr-checker.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Pr Checker
on:
pull_request:
types: [edited, synchronize, opened, reopened]
permissions:
contents: read
pull-requests: write
jobs:
pr-open-check:
permissions:
issues: write
pull-requests: write
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
strategy:
matrix:
node-version: [18.x, 20.x]
steps:
- name: Verify Linked Issue
uses: hattan/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
message: 'Thanks a lot for your contribution! But, PR does not seem to be linked to any issues. Please [manually link to an issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#manually-linking-a-pull-request-or-branch-to-an-issue-using-the-issue-sidebar).'
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v4
with:
run_install: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install packages
run: |
pnpm install
- name: Code Format
id: codeFormat
run: |
pnpm run format:check
#- name: Unit Test
# id: unitTest
# run: |
# pnpm run test:headless
- name: Add Code Format Fail Comment
if: always() && steps.codeFormat.outcome == 'failure'
uses: actions-cool/issues-helper@v3
with:
actions: 'create-comment'
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
body: |
Thanks a lot for your contribution! But, PR does not seem to fit our code format standards. Please run the 'pnpm run format' command and commit the changes.
#- name: Add Unit Test Fail Comment
# if: always() && steps.unitTest.outcome == 'failure'
# uses: thollander/actions-comment-pull-request@v1
# with:
# message: |
# Thanks a lot for your contribution! But, Unit tests failed. You can check the unit tests with the command 'pnpm run test:headless' and commit the changes.
# - name: Add Label
# if: ${{ failure() }}
# uses: actions-ecosystem/action-add-labels@v1
# with:
# labels: 'Resolution: Needs Revision'
# - name: Remove Label
# uses: actions-ecosystem/action-remove-labels@v1
# if: ${{ success() }}
# with:
# labels: 'Resolution: Needs Revision'