[UXE-5924] chore: implements lint workflow #21
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run Linters | |
on: | |
pull_request: | |
types: [opened, synchronize] | |
push: | |
branches: | |
- dev | |
env: | |
HUSKY: 0 | |
jobs: | |
eslint: | |
runs-on: ubuntu-latest | |
container: | |
image: node:18-alpine3.18 | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Install SO Dependencies | |
run: apk add --no-cache curl bash git | |
- uses: actions/cache@v2 | |
with: | |
path: '**/node_modules' | |
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} | |
- name: Install Dependencies | |
run: yarn ci | |
- name: Run ESLint | |
run: yarn lint | |
- name: Run Prettier Formatting | |
run: yarn prettier --check src/ | |
# - name: Check for Uncommitted Changes | |
# run: | | |
# git config --global --add safe.directory $(pwd) | |
# git init | |
# if [[ -n $(git status --porcelain) ]]; then | |
# echo "❌ The code is not properly formatted. Run 'yarn format' locally and commit the changes before submitting the PR." | |
# exit 1 | |
# fi | |
# - name: Notify Developer | |
# if: steps.format.outputs.has_issues == 'true' | |
# run: | | |
# echo "⚠️ Attention @${{ github.actor }}!" | |
# echo "::error::Formatting issues were found in your code. Please follow these steps:" | |
# echo "::error::1. Run 'yarn format' locally in your branch" | |
# echo "::error::2. Commit the formatting changes" | |
# echo "::error::3. Push the changes to update the PR" | |
# exit 1 | |
# - name: Success Message | |
# if: steps.format.outputs.has_issues == 'false' | |
# run: | | |
# echo "✅ All files are properly formatted!" |