Cum să integrezi Codacy cu Git — Ghid pas cu pas
DodaTech
Updated 2025-01-15
1 min read
In this tutorial, you'll learn about Cum să integrezi Codacy cu Git. We cover key concepts, practical examples, and best practices to help you understand and apply this topic effectively.
Integrezi Codacy cu Git pentru a analiza automat codul la fiecare push și Pull Request. Codacy suportă GitHub, GitLab, Bitbucket și Azure Repos.
Step-by-Step Fix
1. Integrare cu GitHub
Din Codacy, Settings > Integrations > GitHub. Autorizează aplicația Codacy în GitHub.
# Sau via GitHub App
# Instalează Codacy App în repository-ul tău GitHub
2. Integrare cu GitLab
# Pentru self-hosted GitLab
codacy:
git_provider: gitlab
gitlab_url: https://gitlab.company.com
project_id: 12345
3. Adaugă badge-uri în README
[](https://app.codacy.com/gh/{owner}/{repo})
[](https://app.codacy.com/gh/{owner}/{repo})
4. Configurează webhook-uri manual
# GitHub webhook
curl -X POST https://api.github.com/repos/{owner}/{repo}/hooks \
-H "Authorization: token $GITHUB_TOKEN" \
-d '{"name": "web", "active": true, "events": ["push", "pull_request"],
"config": {"url": "https://app.codacy.com/webhook/github",
"content_type": "json"}}'
Common Mistakes
- Permisiuni insuficiente -- Codacy are nevoie de acces read la cod și write la status checks
- Webhook neconfigurat -- fără Webhook, Codacy nu știe de commit-uri noi
- Branch protejat fără status check -- adaugă Codacy ca status check required în branch protection
- Integrare duplicată -- dacă ai două instanțe Codacy, pot apărea conflicte
- Token expirat -- token-urile de integrare expiră; reînnoiește-le periodic
Practice Exercise
Integrează Codacy cu un Repository GitHub, adaugă badge-urile în README și configurează status check ca required pe branch-ul main.
FAQ
Construit de dezvoltatorii Doda Browser, DodaZIP și Durga Antivirus Pro.
← Previous
Cum să trimiți rapoarte de coverage la Codacy — Ghid pas cu pas
Next →
Cum să excluzi issue-uri în Codacy — Ghid pas cu pas
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro