Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Deploy alias cannot find environment variables

Aperta
#6,898 2 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

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
Da chiarire
Stato di attività
Ferma
Stack tecnologico
github-actions, nodejs, typescript
Ambito
cli, devops

Direzione di ricerca

Inizia con l’esempio github-action.yml e riproduci il comando npx netlify deploy usando netlify-cli 17.37.0, concentrandoti su --alias pod-1 e sulle variabili d’ambiente del sito. Analizza il deploy dell’alias e la gestione dell’ambiente da parte della CLI; il lavoro è completato quando viene confermato se le variabili specifiche dell’alias sono supportate e il comportamento previsto viene documentato o testato.

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

Descrizione

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

Lingua principale
TypeScript
Stelle
1.9k
Fork
478
Merge medio
1g 18h
PR unite (30g)
37

Preparare l'ambiente

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 netlify/cli

Tutte le issue di netlify/cli

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.