Skip to content

[UXE-5924] chore: implements lint workflow #19

[UXE-5924] chore: implements lint workflow

[UXE-5924] chore: implements lint workflow #19

Workflow file for this run

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 format --check
- 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!"