amondnet / amondnet/vercel-action

Preview Url not set if deployment fails

Aberta
#109 1 comentário 1 reação 1 responsável Reivindicada por @amondnet Ver no GitHub
Type: Feature
Linguagem predominante
TypeScript
Estrelas
765
Forks
116
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

# 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.

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.