diff --git a/.githooks/install.sh b/.githooks/install.sh new file mode 100755 index 0000000..34a00ca --- /dev/null +++ b/.githooks/install.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# Install git hooks + +echo "📦 Installing git hooks..." + +# Make hooks executable +chmod +x .githooks/pre-push + +# Configure git to use our hooks directory +git config core.hooksPath .githooks + +echo "✅ Git hooks installed successfully!" diff --git a/.githooks/pre-push b/.githooks/pre-push new file mode 100755 index 0000000..32c2749 --- /dev/null +++ b/.githooks/pre-push @@ -0,0 +1,26 @@ +#!/bin/bash +# Pre-push hook: Lint GitHub Actions workflows before pushing + +set -e + +# Get the list of changed workflow files +changed_workflows=$(git diff --cached --name-only --diff-filter=ACM | grep -E '\.github/workflows/.*\.ya?ml$' || true) + +if [ -n "$changed_workflows" ]; then + echo "🔍 Linting GitHub Actions workflows..." + + if ! command -v actionlint &> /dev/null; then + echo "⚠️ actionlint not found. Installing via mise..." + mise install actionlint + fi + + # Lint the changed workflows + if actionlint -oneline $changed_workflows; then + echo "✅ Workflows lint passed!" + else + echo "❌ Workflow lint failed. Fix the errors above and try again." + exit 1 + fi +else + echo "✅ No workflow changes detected." +fi diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 0000000..c3ea3d9 --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,79 @@ +--- +name: "IntegratedDynamic Infrastructure - Configuration" +description: "Conventions de projet et préférences de codage pour l'infrastructure" +--- + +# Instructions pour GitHub Copilot + +## Onboarding + +### Gestion des dépendances + +Les dépendances du projet sont gérées via **mise**. + +**Installation** : +```bash +mise install +``` + +ℹ️ **Automatique** : Une fois `mise.toml` modifié, `mise install` se lance automatiquement via un hook. + +## Conventions de code + +### Branches + +Je dois TOUJOURS utiliser [Conventional Branch](https://conventional-branch.github.io/). + +Format strict: +``` +/ +``` + +Types: `feature/`, `bugfix/`, `hotfix/`, `ci/`, `chore/` + +Exemples: +- `feature/add-authentication-middleware` +- `bugfix/fix-memory-leak` +- `ci/add-github-actions-workflow` + +Règles obligatoires: +- Minuscules, chiffres, hyphens et dots uniquement +- Pas de hyphens/dots consécutifs ou aux extrémités +- Inclure ticket number si applicable: `feature/issue-456-add-auth` + +### Commits + +Utiliser [Conventional Commits](https://www.conventionalcommits.org/) : +``` +[scope]: +``` + +Types : `feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `chore` + +### Pull Requests + +**Titre** : Doit être descriptif et clair. Format recommandé avec type et description. +``` +: Clear description of what the PR does +``` + +**Body** : Contexte, changements, issues liées (via `Closes #123`), et instructions de test. + +**Comportement automatique** : Après chaque `commit` + `push` sur une branche, créer automatiquement une PR en **draft** (si elle n'existe pas déjà) avec titre et body appropriés. + +Utiliser [Conventional Comments](https://conventionalcomments.org/) pour les reviews : +``` +