Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Deploy alias cannot find environment variables

オープン
#6,898 コメント 2 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
github-actions, nodejs, typescript
領域
cli, devops

調査の方向性

github-action.yml の例から始め、netlify-cli 17.37.0 を使用して npx netlify deploy コマンドを再現し、--alias pod-1 とサイトの環境変数に焦点を当てます。CLI の alias デプロイと環境変数の処理を追跡します。alias 固有の変数がサポートされているかを確認し、期待される動作を文書化またはテストできれば完了です。

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

説明

type: bug
Describe the bug

Hi, there. I have github action that deploys production branch to different alias upon release tag published event. For this alias deploy, I want to use environment variables that are different from my production or branch deployment.

github-action.yml

name: "Deploy POD"

on:
  release:
    types: ["published"]

jobs:
  deploy:
    runs-on: ubuntu-latest

    steps:
      - name: Repository checkout
        uses: actions/checkout@v4

      - name: Install Dependencies
        run: npm ci

      - name: Build project
        run: npm run build

      - name: Deploy to Netlify
        id: netlify_deploy
        run: |
          npx netlify deploy \
            --dir dist \
            --site ${{ secrets.NETLIFY_SITE_ID }} \
            --auth ${{ secrets.NETLIFY_API_TOKEN }} \
            --alias pod-1 \
            --message "Pod-1 deploy ${{ github.event.release.tag_name }}"

However, aliased deploy preview is not running properly because it is not reading any environment variable from my netlify site. I’ve tried to add env variables and specify deploy context as “branch deploys” and “custom branch” but both options have failed.

Is there a way to set environment variables for specific deploy alias?

My overall goal is to deploy new instance of production branch with its own environment variables without maintaining git branch

Steps to reproduce

Try to run following github action and check live URL

Configuration

No response

Environment

System:
OS: macOS 15.0.1
CPU: (12) arm64 Apple M2 Max
Memory: 109.33 MB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.11.0 - ~/.nvm/versions/node/v20.11.0/bin/node
npm: 10.2.4 - ~/.nvm/versions/node/v20.11.0/bin/npm
npmGlobalPackages:
netlify-cli: 17.37.0

主要言語
TypeScript
スター
1.9k
フォーク
478
平均マージ
2日 17時間
マージ済み PR(30日)
63

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

netlify/cli のほかの issue

netlify/cli の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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