Skip to content

Fix trigger preview #1593

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 17, 2025
Merged

Fix trigger preview #1593

merged 1 commit into from
Jul 17, 2025

Conversation

phenylshima
Copy link
Member

@phenylshima phenylshima commented Jul 8, 2025

問題のWarnは以下のようなものです.

Only production deployment was conducted. The alias deploy-preview-1593 was ignored.

これは以下の行で出ています.
https://github.com/nwtgck/actions-netlify/blob/f242d4c9f946f94d2ed8413888eaf35e1f7e848d/src/main.ts#L110-L112

その条件はproductionDeploy && alias !== undefinedがtrueであることです.すなわち,productionDeployがtrueになっていますので,これをfalseにする必要があります.

productionDeployは以下の行で判定されます.
https://github.com/nwtgck/actions-netlify/blob/f242d4c9f946f94d2ed8413888eaf35e1f7e848d/src/main.ts#L89-L92

productionDeploytrueになるためには,

  • productionBranchが定義されており,かつcontext.refがrefs/heads/${productionBranch}である
  • productionDeployが"true"である

のいずれかを満たす必要があります.後者は指定されておらず,デフォルトはfalseであることから,前者がtrueになっていると予想できます.

なお,issue_comment triggerのリファレンスによれば,refは"Default branch"になるとされているので,context.refの条件も満たすと思われ,前者が原因である可能性は高いです.
https://docs.github.com/en/actions/reference/events-that-trigger-workflows#issue_comment

以上から,「preductionBranchを定義しない」ことで,productionDeployをfalseにし,aliasを使ってデプロイさせることができると考えられます.

@phenylshima phenylshima force-pushed the fix-trigger-preview branch from 7746683 to 83a68f0 Compare July 8, 2025 13:31
@phenylshima
Copy link
Member Author

/deploy-preview

Copy link

github-actions bot commented Jul 8, 2025

🎉 Published on https://utelecon.netlify.app as production
🚀 Deployed on https://686d1e88301907934f218422--utelecon.netlify.app

@seieric seieric added the web-development Tasks of web-development category label Jul 8, 2025
@seieric seieric requested a review from Copilot July 17, 2025 05:19
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes an issue where Netlify deployments were being treated as production deployments instead of preview deployments, causing the deploy preview alias to be ignored with a warning message.

  • Removes the production-branch: master configuration from the Netlify GitHub Action
  • Ensures that issue_comment triggered workflows create preview deployments with aliases instead of production deployments

Copy link
Member

@seieric seieric left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

説明していただいた部分の実装を確認しました。
実際に動作するかどうかはActionsの都合上確認できておりませんが、新たな問題を引き起こすものではないと判断してApproveします。

@Ryocat
Copy link
Member

Ryocat commented Jul 17, 2025

ありがとうございます。マージしてみます。

@Ryocat Ryocat merged commit dc37ca1 into master Jul 17, 2025
3 checks passed
@Ryocat Ryocat deleted the fix-trigger-preview branch July 17, 2025 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
web-development Tasks of web-development category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants