Cannot add teams to repo.yml

Aperta
#809 8 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
github, javascript
Ambito
api, backend

Direzione di ricerca

Inizia con l’esempio .github/repos/Prequal.yml e riproduci l’applicazione di un team esistente o di un team già associato al repository nell’app probot/settings self-hosted. Segui il punto di ingresso per l’aggiunta di un team e verifica che l’applicazione della configurazione venga completata senza l’errore 422 di GitHub Enterprise.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

Problem Description

What's Happening

We're managing repository-level team permissions using individual repo YAML files (e.g., Mobile.yml, Web.yml, infra.yml) under the .github/repos directory. We do not maintain any team configurations in settings.yml.

The intent is to explicitly grant certain teams (like all engineering teams) permissions to deploy to non-prod environments. For example:

# .github/repos/Prequal.yml

repository:
  name: Prequal
  teams:
    - name: SRE
      permission: maintain
    - name: "Engineering Members"
      permission: push

However, when applying these settings, we encounter the following error:

Error adding team: 422

API response:

{
  "message": "Validation Failed",
  "errors": [
    {
      "resource": "Team",
      "code": "unprocessable",
      "field": "data",
      "message": "Name must be unique for this org"
    }
  ],
  "documentation_url": "https://docs.github.com/rest/teams/teams#create-a-team",
  "status": "422"
}

This seems to happen when the team already exists or is already associated with the repository.

Expected Behavior

We want to know if there's a way to skip adding a team if it already exists or is already associated with the repository, to avoid the 422 error. Ideally, the settings app should be idempotent in this case.


Context

  • GitHub App: Self-hosted instance of probot/settings
  • Platform: GitHub Enterprise (EMU)
  • Versions:
    • probot/settings: [please insert version]
    • GitHub Enterprise: [please insert version]

Lingua principale
JavaScript
Stelle
942
Fork
238
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di github-community-projects/safe-settings

Tutte le issue di github-community-projects/safe-settings

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.