devcontainers / devcontainers/ci

Incorrect parsing of environment variable when quoted

Aperta
#168 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
TypeScript
Stelle
497
Fork
102
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

I was passing in a URL endpoint as an environment variable to a workflow step to run end-to-end test via Newman, and I was getting a protocol error through by Newman. After some investigation trying to access the same endpoint using wget I noticed that variable being passed in was being parsed incorrectly.

The problem arose when I was calling it like this:

```
- name: Run Tests
uses: devcontainers/ci@v0.2
with:
imageName: ghcr.io/microsoft/my-devcontainer
runCmd: make run-tests
imageTag: ${{ env.TAG }}
env: API_ENDPOINT="https://${{ env.APP_NAME }}.azurewebsites.net"
```

The solution was to remove the quotes around the variable like this:

```
- name: Run Tests
uses: devcontainers/ci@v0.2
with:
imageName: ghcr.io/microsoft/my-devcontainer
runCmd: make run-tests
imageTag: ${{ env.TAG }}
env: API_ENDPOINT=https://${{ env.APP_NAME }}.azurewebsites.net
```

But as a string I would expect it to be able to handle either format.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia riproducendo il workflow devcontainers/ci con l’input env mostrato nell’issue, confrontando i valori di API_ENDPOINT tra virgolette e senza virgolette. Esamina come l’Action gestisce questo input; il lavoro è completato quando entrambe le forme preservano l’endpoint completo e il workflow Newman non segnala più un errore di protocollo.

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

Valutazione

Stack tecnologico
github-actions, typescript
Ambito
ci-cd, devops
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.