Examinați insignele fluxului de lucru

Finalizat

Insignele de stare a fluxului de lucru oferă vizibilitate dintr-o privire asupra stării proiectului și a stării construcției. Acestea sunt esențiale pentru a comunica calitatea proiectului utilizatorilor, contribuitorilor și părților interesate care vă vizitează depozitul.

Înțelegerea insignelor fluxului de lucru

Insignele de stare sunt imagini dinamice care afișează starea curentă a fluxurilor de lucru GitHub Actions. Acestea se actualizează automat pentru a reflecta cea mai recentă stare a construcției și pentru a oferi feedback vizual imediat despre starea conductei CI/CD a proiectului.

De ce contează insignele de flux de lucru

Credibilitatea proiectului: Insignele semnalează că proiectul respectă bunele practici de dezvoltare Evaluare rapidă: Contribuitorii pot vedea imediat dacă proiectul este stabil Asigurarea calității: Insignele eșuate avertizează întreținătorii cu privire la problemele care necesită atenție Aspect profesional: Insignele bine configurate îmbunătățesc imaginea profesională a proiectului dvs.

Crearea și configurarea insignelor fluxului de lucru

Sintaxa de bază a insignei

Formatul URL standard pentru insignele fluxului de lucru GitHub Actions este:

https://github.com/<OWNER>/<REPOSITORY>/actions/workflows/<WORKFLOW_FILE>/badge.svg

Componente URL:

  • <OWNER>: numele de utilizator GitHub sau numele organizației
  • <REPOSITORY>: Numele depozitului
  • <WORKFLOW_FILE>: Numele fișierului fluxului de lucru (de exemplu, ci.yml)

Insigne specifice ramurii

Afișați starea pentru anumite ramuri prin adăugarea parametrului ramurii:

https://github.com/<OWNER>/<REPOSITORY>/actions/workflows/<WORKFLOW_FILE>/badge.svg?branch=<BRANCH_NAME>

Implementări practice de insigne

Integrare README.md de bază

# My Awesome Project

![CI](https://github.com/myorg/myproject/actions/workflows/ci.yml/badge.svg)
![Deploy](https://github.com/myorg/myproject/actions/workflows/deploy.yml/badge.svg)

[![Build Status](https://github.com/myorg/myproject/actions/workflows/ci.yml/badge.svg)](https://github.com/myorg/myproject/actions/workflows/ci.yml)

A description of your project...

Afișarea insignelor cu mai multe ramuri

# Project Status

| Branch  | Status                                                                                                  |
| ------- | ------------------------------------------------------------------------------------------------------- |
| Main    | ![Main Branch](https://github.com/myorg/myproject/actions/workflows/ci.yml/badge.svg?branch=main)       |
| Develop | ![Develop Branch](https://github.com/myorg/myproject/actions/workflows/ci.yml/badge.svg?branch=develop) |
| Release | ![Release Branch](https://github.com/myorg/myproject/actions/workflows/ci.yml/badge.svg?branch=release) |

Colectare avansată de insigne

# Build & Quality Status

[![CI Pipeline](https://github.com/myorg/myproject/actions/workflows/ci.yml/badge.svg)](https://github.com/myorg/myproject/actions/workflows/ci.yml)
[![Security Scan](https://github.com/myorg/myproject/actions/workflows/security.yml/badge.svg)](https://github.com/myorg/myproject/actions/workflows/security.yml)
[![Deploy to Production](https://github.com/myorg/myproject/actions/workflows/deploy.yml/badge.svg)](https://github.com/myorg/myproject/actions/workflows/deploy.yml)
[![Code Coverage](https://codecov.io/gh/myorg/myproject/branch/main/graph/badge.svg)](https://codecov.io/gh/myorg/myproject)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

Captură de ecran a unei insigne de flux de lucru eșuate care arată starea roșie care indică eșecul construcției.

Cele mai bune practici pentru insignele fluxului de lucru

Plasarea strategică a insignelor

Partea de sus a README: Cea mai vizibilă locație pentru starea construcției principale Secțiunea de stare: Secțiune dedicată pentru starea proiectului Șabloane de solicitare de extragere: Includeți insigne în descrierile PR pentru context

<!-- In your README.md -->

# Project Name

![Build](https://github.com/owner/repo/actions/workflows/build.yml/badge.svg)
![Tests](https://github.com/owner/repo/actions/workflows/test.yml/badge.svg)

<!-- Rest of your README content -->

## Status Dashboard

### Build Pipeline

- **Main Branch**: ![Main](https://github.com/owner/repo/actions/workflows/ci.yml/badge.svg?branch=main)
- **Development**: ![Dev](https://github.com/owner/repo/actions/workflows/ci.yml/badge.svg?branch=develop)

### Quality Metrics

- **Code Coverage**: ![Coverage](https://codecov.io/gh/owner/repo/branch/main/graph/badge.svg)
- **Security**: ![Security](https://github.com/owner/repo/actions/workflows/security.yml/badge.svg)

Nume semnificative ale fluxului de lucru

Asigurați-vă că fișierele fluxului de lucru au nume descriptive care creează etichete clare cu insigne:

# .github/workflows/ci.yml
name: "CI Pipeline"  # Creates badge with "CI Pipeline" label

# .github/workflows/deploy-production.yml
name: "Production Deployment"  # Creates badge with "Production Deployment" label

# .github/workflows/security-scan.yml
name: "Security Analysis"  # Creates badge with "Security Analysis" label

Modele de organizare a insignelor

Grupate după funcție:

## Build & Test

![CI](https://github.com/owner/repo/actions/workflows/ci.yml/badge.svg)
![Tests](https://github.com/owner/repo/actions/workflows/test.yml/badge.svg)

## Deployment

![Staging](https://github.com/owner/repo/actions/workflows/deploy-staging.yml/badge.svg)
![Production](https://github.com/owner/repo/actions/workflows/deploy-prod.yml/badge.svg)

## Quality & Security

![CodeQL](https://github.com/owner/repo/actions/workflows/codeql.yml/badge.svg)
![Dependency Check](https://github.com/owner/repo/actions/workflows/deps.yml/badge.svg)

Faceți insignele pe care se poate face clic pentru a oferi acces direct la detaliile fluxului de lucru:

[![Build Status](https://github.com/owner/repo/actions/workflows/ci.yml/badge.svg)](https://github.com/owner/repo/actions/workflows/ci.yml)
[![Deploy Status](https://github.com/owner/repo/actions/workflows/deploy.yml/badge.svg)](https://github.com/owner/repo/actions/workflows/deploy.yml)

Integrare insignă personalizată

Insigne de serviciu terță parte

Completați insignele GitHub Actions cu indicatori externi de serviciu:

<!-- Combine GitHub Actions with external services -->

![GitHub Actions](https://github.com/owner/repo/actions/workflows/ci.yml/badge.svg)
[![Codecov](https://codecov.io/gh/owner/repo/branch/main/graph/badge.svg)](https://codecov.io/gh/owner/repo)
[![Dependabot](https://api.dependabot.com/badges/status?host=github&repo=owner/repo)](https://dependabot.com)
[![npm version](https://badge.fury.io/js/package-name.svg)](https://badge.fury.io/js/package-name)

Conținut dinamic al insignei

Creați insigne care afișează informații suplimentare:

<!-- Show specific branch status -->

![Main Branch](https://github.com/owner/repo/actions/workflows/ci.yml/badge.svg?branch=main&event=push)

<!-- Show latest release status -->

![Release](https://github.com/owner/repo/actions/workflows/release.yml/badge.svg?branch=main&event=release)

Depanarea și monitorizarea insignelor

Probleme și soluții comune

Insigna nu se actualizează:

  • Verificați calea fișierului fluxului de lucru în URL
  • Verificați dacă fluxul de lucru s-a finalizat cel puțin o dată
  • Asigurați-vă că numele fluxului de lucru se potrivește exact

Insigna arată starea "necunoscută":

  • Fișierul fluxului de lucru nu există sau are erori de sintaxă
  • Depozitul sau fluxul de lucru este privat fără permisiuni adecvate
  • Parametrii URL sunt malformați

Monitorizarea stării insignei

Configurați alerte pentru modificările stării insignei:

# .github/workflows/badge-monitor.yml
name: Badge Status Monitor

on:
  workflow_run:
    workflows: ["CI Pipeline"]
    types: [completed]

jobs:
  notify-status:
    runs-on: ubuntu-latest
    if: ${{ github.event.workflow_run.conclusion == 'failure' }}
    steps:
      - name: Notify team of failing badge
        uses: 8398a7/action-slack@v3
        with:
          status: failure
          text: "🚨 CI Pipeline badge is now showing failure status"
        env:
          SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

Strategii avansate de insigne

Tablou de bord multi-mediu

## Environment Status

| Environment     | Build                                                                                     | Deploy                                                                                  | Health Check                                                                            |
| --------------- | ----------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| **Development** | ![Build](https://github.com/owner/repo/actions/workflows/ci.yml/badge.svg?branch=develop) | ![Deploy](https://github.com/owner/repo/actions/workflows/deploy-dev.yml/badge.svg)     | ![Health](https://github.com/owner/repo/actions/workflows/health-dev.yml/badge.svg)     |
| **Staging**     | ![Build](https://github.com/owner/repo/actions/workflows/ci.yml/badge.svg?branch=staging) | ![Deploy](https://github.com/owner/repo/actions/workflows/deploy-staging.yml/badge.svg) | ![Health](https://github.com/owner/repo/actions/workflows/health-staging.yml/badge.svg) |
| **Production**  | ![Build](https://github.com/owner/repo/actions/workflows/ci.yml/badge.svg?branch=main)    | ![Deploy](https://github.com/owner/repo/actions/workflows/deploy-prod.yml/badge.svg)    | ![Health](https://github.com/owner/repo/actions/workflows/health-prod.yml/badge.svg)    |

Tabloul de bord de sănătate a proiectului

# Project Health Dashboard

## Core Pipeline

[![Build](https://github.com/owner/repo/actions/workflows/build.yml/badge.svg)](https://github.com/owner/repo/actions/workflows/build.yml)
[![Test](https://github.com/owner/repo/actions/workflows/test.yml/badge.svg)](https://github.com/owner/repo/actions/workflows/test.yml)
[![Lint](https://github.com/owner/repo/actions/workflows/lint.yml/badge.svg)](https://github.com/owner/repo/actions/workflows/lint.yml)

## Security & Quality

[![Security Scan](https://github.com/owner/repo/actions/workflows/security.yml/badge.svg)](https://github.com/owner/repo/actions/workflows/security.yml)
[![Dependency Audit](https://github.com/owner/repo/actions/workflows/audit.yml/badge.svg)](https://github.com/owner/repo/actions/workflows/audit.yml)
[![Code Quality](https://sonarcloud.io/api/project_badges/measure?project=owner_repo&metric=alert_status)](https://sonarcloud.io/dashboard?id=owner_repo)

## Deployment Status

[![Staging Deploy](https://github.com/owner/repo/actions/workflows/deploy-staging.yml/badge.svg)](https://github.com/owner/repo/actions/workflows/deploy-staging.yml)
[![Production Deploy](https://github.com/owner/repo/actions/workflows/deploy-prod.yml/badge.svg)](https://github.com/owner/repo/actions/workflows/deploy-prod.yml)

Insignele de flux de lucru sunt mai mult decât simple indicatori de stare - sunt un instrument de comunicare care construiește încredere, oferă transparență și demonstrează angajamentul tău față de calitatea codului. Folosește-le strategic pentru a crea o prezentare profesională și informativă a proiectului.

Pentru documentația insignei, consultați Adăugarea unei insigne de stare a fluxului de lucru.