chore: simplification du remplissage des issues et des pull requests + nouveaux workflows + fixs extentions de fichiers incorrects #1640
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: Checks (TypeScript + ESLint) | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
lint-main: | |
name: 🛠️ TypeScript and ESLint on Main | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/remotes/origin/main' | |
steps: | |
- name: 📥 Checkout code | |
uses: actions/checkout@v3 | |
- name: ⚙️ Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
- name: 💾 Install dependencies | |
run: npm ci | |
- name: 🛠️ Commit and Push Fixes ESLint (Main) | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
npx eslint . --fix | |
if git diff --quiet; then | |
echo "No changes to commit." | |
else | |
git add . | |
git commit -m "🔧 Auto-fix ESLint issues" | |
git push | |
fi | |
- name: 🔍 Run TypeScript and ESLint checks | |
run: npm run lint | |
lint-development: | |
name: 🛠️ TypeScript and ESLint on Pull Request | |
runs-on: ubuntu-latest | |
if: github.ref != 'refs/remotes/origin/main' | |
steps: | |
- name: 📥 Checkout code | |
uses: actions/checkout@v3 | |
- name: ⚙️ Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
- name: 💾 Install dependencies | |
run: npm ci | |
- name: 🔍 Run TypeScript and ESLint checks | |
run: npm run lint |