amondnet / amondnet/vercel-action

Preview Url not set if deployment fails

Aperta
#109 1 commento 1 reazione 1 assegnatario Rivendicata da @amondnet Vedi su GitHub
Type: Feature
Lingua principale
TypeScript
Stelle
765
Fork
116
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

# Overview
Hi there, I am using this action to deploy my project to Vercel and then retrieve the build logs afterwards such that I don't need to go into Vercel to check the logs and send them to a deployment tracker.

## Issue
When the build deploys successfully, the preview-url is set successfully and I can use `steps.[step-id].outputs.preview-url` in the step that follows to retrieve and send the build logs. However, if the deploy goes wrong for any reason and exists with a non success exit code (e.g. exit code 1), no preview-url is set and I can't send the build logs to our deployment tracker. Funnily enough when the build fails is the most important time to check the build logs, so this would be great to get working.

## Steps to reproduce
My pipeline looks something like this

```yaml
- name: Deploy
uses: amondnet/vercel-action@v20
id: vercel-deploy
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID}}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID}}
scope: ${{ secrets.VERCEL_ORG_ID }}
alias-domains: ...
- name: Retrieve build logs
if: always() # always run step even if deploy fails
run: /usr/local/bin/npx vercel logs ${{steps.vercel-deploy.outputs.preview-url}} -n -1 -t ${{secrets.VERCEL_TOKEN}} --scope ${{secrets.VERCEL_ORG_ID}}
```

If the deploy step fails the second step doesn't receive the preview-url and just runs `Run /usr/local/bin/npx vercel logs -n -1 -t *** --scope ***` which just leaves us with the cli help message.

## Conclusion
It would be great if the preview-url is set so that following steps can use it to interact with the CLI even if the deploy fails.

I've tried to include as much info as possible, but please let me know if there is anything more I can do to be of use.

Thanks in advance.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.