Deployment protection rules for issue comment trigger
- Lingua principale
- TypeScript
- Stelle
- 576
- Fork
- 74
- Merge medio
- 11h 7m
- PR unite (30g)
- 1
Descrizione
### Details
Hi,
Trying to use deployment protection rules in GitHub for setting restrictions on that you must have a branch named "release/*" for example to deploy to production. The problem is using [environment](https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#jobsjob_idenvironment) when deploying in a PR with branch deploy you get the error:
> Branch "main" is not allowed to deploy to dev due to environment protection rules.
This is because when triggering the workflow on issue_comment it runs on the main branch and therefore the deployment protection rule does not work.
Happen to know a solution to this or do we have to develop our own deployment protection in the workflow?
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia tracciando il workflow issue_comment e il modo in cui seleziona il riferimento del deployment prima di applicare le regole di protezione dell'ambiente. Verifica come GitHub Actions valuta il branch per i deployment attivati dai commenti sulle issue, quindi definisci un modo supportato affinché il deployment utilizzi il contesto previsto della pull request o del branch. Il lavoro è completato quando la regola di protezione consente o rifiuta correttamente il deployment in base a tale contesto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- github-actions
- Ambito
- ci-cd, devops
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 35/100