Azure / Azure/static-web-apps-cli

CLI doesn't produce a failure related exit code in case of failure

Ouverte
#783 6 commentaires 8 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Langage dominant
TypeScript
Étoiles
668
Forks
155
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

Describe the bug
A clear and concise description of what the bug is.

Any error coming from running the CLI doesn't have an exit code that represents a failure. When I run the CLI directly (not by using the github actions action), I don't get an error from it. One example:

Run ./node_modules/.bin/swa deploy --no-use-keychain --config-name dev --env pr124

Welcome to Azure Static Web Apps CLI (1.1.4)

Using configuration "dev" from file:
  /home/runner/work/repo/repo/swa-cli.config.json

Deploying front-end files from folder:
  /home/runner/work/repo/repo/dist

Consider providing api-language and version using --api-language and --api-version flags,
    otherwise default values apiLanguage: node and apiVersion: 16 will apply
Checking Azure session...
✔ Successfully logged into Azure!
✔ Saved project credentials in .env file.

Checking project "project" settings...
✔ Successfully setup project!

Deploying to environment: pr124


Found configuration file:
  /home/runner/work/repo/repo/staticwebapp.config.json

Deploying project to Azure Static Web Apps...
Could not find StaticSitesClient local binary
- Downloading https://swalocaldeploy.azureedge.net/downloads/1.0.024941/linux/StaticSitesClient@1.0.024941
[swa] ✔ Downloading https://swalocaldeploy.azureedge.net/downloads/1.0.024941/linux/StaticSitesClient@1.0.024941
- Preparing deployment. Please wait...
✖ The content server has rejected the request with: BadRequest
✖ Reason: This Static Web App already has the maximum number of staging environments (3). Please remove one and try again.

To Reproduce
Steps to reproduce the behavior:

  1. Use the SWA CLI manually in github actions
  2. Run a command that will fail
  3. The workflow will not fail

Expected behavior

I expected the CLI to exit with a code that represents a failure, so the workflow would fail.

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez au point d’entrée ./node_modules/.bin/swa deploy et reproduisez l’échec avec la commande de deploy indiquée, en utilisant la configuration swa-cli.config.json et staticwebapp.config.json du rapport. Suivez la manière dont l’erreur de déploiement signalée est renvoyée au processus CLI ; le travail est terminé lorsqu’un déploiement échoué produit un code de sortie différent de zéro et entraîne l’échec du workflow.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
typescript
Domaine
cli
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
42/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.