primevue-mirror/.github/workflows/pr-checker.yml

83 lines
2.9 KiB
YAML
Raw Normal View History

2022-12-20 06:32:43 +00:00
name: Pr Checker
on:
2024-06-24 06:42:36 +00:00
pull_request:
types: [edited, synchronize, opened, reopened]
2022-12-20 06:32:43 +00:00
permissions:
2024-06-24 06:42:36 +00:00
contents: read
pull-requests: write
2022-12-20 06:32:43 +00:00
jobs:
2024-06-24 06:42:36 +00:00
pr-open-check:
permissions:
issues: write
pull-requests: write
runs-on: ubuntu-latest
2022-12-20 06:32:43 +00:00
env:
2024-06-24 06:42:36 +00:00
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Verify Linked Issue
uses: hattan/verify-linked-issue-action@v1.1.5
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) or mention it in the description using #<issue_id>.'
2022-12-20 06:32:43 +00:00
2024-06-24 06:42:36 +00:00
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
2024-06-28 08:56:33 +00:00
- uses: actions/setup-node@v4
2024-06-24 06:42:36 +00:00
with:
node-version: 18
cache: 'pnpm'
2022-12-20 06:32:43 +00:00
2024-06-24 06:42:36 +00:00
- name: Install packages
run: |
pnpm run setup
2022-12-20 06:32:43 +00:00
2024-06-24 06:42:36 +00:00
- name: Code Format
id: codeFormat
run: |
pnpm run format:check
2022-12-20 06:32:43 +00:00
2024-06-24 06:42:36 +00:00
- name: Unit Test
id: unitTest
run: |
pnpm run test:unit
2022-12-20 06:32:43 +00:00
2024-06-24 06:42:36 +00:00
- name: Lint
run: |
pnpm run lint
2023-04-28 16:19:24 +00:00
2024-06-24 06:42:36 +00:00
- name: Security
run: |
pnpm run security:check
2023-04-28 16:19:24 +00:00
2024-06-24 06:42:36 +00:00
- name: Add Code Format Fail Comment
if: always() && steps.codeFormat.outcome == 'failure'
uses: thollander/actions-comment-pull-request@v1
with:
message: |
Thanks a lot for your contribution! But, PR does not seem to fit our code format standards. Please run the 'npm run format' command and commit the changes.
2022-12-20 06:32:43 +00:00
2024-06-24 06:42:36 +00:00
- 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 'npm run test:unit' and commit the changes.
2022-12-20 06:32:43 +00:00
2024-06-24 06:42:36 +00:00
- name: Add Label
if: ${{ failure() }}
uses: actions-ecosystem/action-add-labels@v1
with:
labels: 'Resolution: Needs Revision'
2022-12-20 06:32:43 +00:00
2024-06-24 06:42:36 +00:00
- name: Remove Label
uses: actions-ecosystem/action-remove-labels@v1
if: ${{ success() }}
with:
labels: 'Resolution: Needs Revision'