gkd-subscription/.github/workflows/pull_request_check.yml

51 lines
1.1 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: pull_request_check
on:
pull_request:
branches:
- main
jobs:
check:
if: github.repository == 'gkd-kit/subscription'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get changed files
id: changed_files
uses: tj-actions/changed-files@v39
- name: Check changed files
run: |
if [ ${{ steps.changed_files.outputs.all_changed_files_count }} -ne 1 ]; then
echo "your changed files count must be 1"
exit 1
fi
for file in ${{ steps.changed_files.outputs.all_changed_files }}; do
echo "$file was changed"
done
- uses: actions/setup-node@v3
with:
node-version: 20
- uses: pnpm/action-setup@v2
- run: pnpm install
- run: pnpm run check
- run: pnpm run format
- run: pnpm run lint
- name: check format status
run: |
status=$(git status --porcelain)
if [ -n "$status" ]; then
echo "Something wasnt formatted properly"
git --no-pager diff
exit 1
fi