github / github/branch-deploy

Deployment protection rules for issue comment trigger

オープン
#388 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
question
主要言語
TypeScript
スター
576
フォーク
74
平均マージ
11時間 7分
マージ済み PR(30日)
1

説明

### 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?

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず issue_comment ワークフローと、環境保護ルールを適用する前にデプロイ参照を選択する仕組みを追跡します。issue コメントからトリガーされたデプロイについて、GitHub Actions がブランチをどのように評価するかを確認し、続いてデプロイが意図した pull request またはブランチのコンテキストを使用できる、サポートされる方法を定義します。このコンテキストに基づいて保護ルールがデプロイを正しく許可または拒否できれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
github-actions
領域
ci-cd, devops
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
静か
明瞭さ
説明が足りない
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。