Pr checker fixes

active-menu
tugcekucukoglu 2024-06-24 09:42:36 +03:00
parent 40063466fb
commit bdf1570214
2 changed files with 65 additions and 63 deletions

View File

@ -22,7 +22,7 @@ jobs:
- name: Install pnpm - name: Install pnpm
uses: pnpm/action-setup@v4 uses: pnpm/action-setup@v4
with: with:
version: 9 version: 9
- name: Use Node.js ${{ matrix.node-version }} - name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4 uses: actions/setup-node@v4
@ -45,7 +45,6 @@ jobs:
run: | run: |
pnpm run format:check pnpm run format:check
- name: Code Format - name: Code Format
if: always() && steps.codeFormatCheck.outcome == 'failure' if: always() && steps.codeFormatCheck.outcome == 'failure'
run: | run: |

View File

@ -1,79 +1,82 @@
name: Pr Checker name: Pr Checker
on: on:
pull_request: pull_request:
types: [edited, synchronize, opened, reopened] types: [edited, synchronize, opened, reopened]
permissions: permissions:
contents: read contents: read
pull-requests: write pull-requests: write
jobs: jobs:
pr-open-check: pr-open-check:
permissions: permissions:
issues: write issues: write
pull-requests: write pull-requests: write
runs-on: ubuntu-latest runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Verify Linked Issue
uses: hattan/verify-linked-issue-action@v1.1.5
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: steps:
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>.' - 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>.'
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/setup-node@v4 - uses: pnpm/action-setup@v4
with: with:
node-version: 18 version: 9
cache: 'npm' - uses: actions/setup-node@4
with:
node-version: 18
cache: 'pnpm'
- name: Install packages - name: Install packages
run: | run: |
pnpm run setup pnpm run setup
- name: Code Format - name: Code Format
id: codeFormat id: codeFormat
run: | run: |
pnpm run format:check pnpm run format:check
- name: Unit Test - name: Unit Test
id: unitTest id: unitTest
run: | run: |
pnpm run test:unit pnpm run test:unit
- name: Lint - name: Lint
run: | run: |
pnpm run lint pnpm run lint
- name: Security - name: Security
run: | run: |
pnpm run security:check pnpm run security:check
- name: Add Code Format Fail Comment - name: Add Code Format Fail Comment
if: always() && steps.codeFormat.outcome == 'failure' if: always() && steps.codeFormat.outcome == 'failure'
uses: thollander/actions-comment-pull-request@v1 uses: thollander/actions-comment-pull-request@v1
with: with:
message: | 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. 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.
- name: Add Unit Test Fail Comment - name: Add Unit Test Fail Comment
if: always() && steps.unitTest.outcome == 'failure' if: always() && steps.unitTest.outcome == 'failure'
uses: thollander/actions-comment-pull-request@v1 uses: thollander/actions-comment-pull-request@v1
with: with:
message: | 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. 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.
- name: Add Label - name: Add Label
if: ${{ failure() }} if: ${{ failure() }}
uses: actions-ecosystem/action-add-labels@v1 uses: actions-ecosystem/action-add-labels@v1
with: with:
labels: 'Resolution: Needs Revision' labels: 'Resolution: Needs Revision'
- name: Remove Label - name: Remove Label
uses: actions-ecosystem/action-remove-labels@v1 uses: actions-ecosystem/action-remove-labels@v1
if: ${{ success() }} if: ${{ success() }}
with: with:
labels: 'Resolution: Needs Revision' labels: 'Resolution: Needs Revision'