amondnet / vercel-action

This action make a deployment with github actions instead of Vercel builder.
https://vercel.com/docs/cli
MIT License
619 stars 95 forks source link

env-vars with spaces fail when passed using `--env` in `vercel-args` #236

Closed wilsonpage closed 4 months ago

wilsonpage commented 10 months ago
  1. Set a repo secret that includes spaces (eg -----BEGIN PRIVATE KEY----- …)
  2. Reference it in the Github Actions Workflow.
- uses: amondnet/vercel-action@v25
  with:
    vercel-token: ${{ secrets.VERCEL_TOKEN }}
    …
    vercel-args: >-
      --env MY_VAR=${{ secrets.VAR_WITH_SPACES }}
  1. Observe bash error: Error! The specified file or directory "PRIVATE" does not exist.

Wrapping with " still fails, so I'm assuming this is an issue in vercel-action.

- uses: amondnet/vercel-action@v25
  with:
    vercel-token: ${{ secrets.VERCEL_TOKEN }}
    …
    vercel-args: >-
      --env MY_VAR="${{ secrets.VAR_WITH_SPACES }}"
skyf0l commented 6 months ago

Fixed by #237 and merged. Until the release you can use a commit pin as follows in your workflow:

- uses: amondnet/vercel-action@8433ae13f35aa62d68184a8fc369ce6b0143b0a3
  with:
    vercel-token: ${{ secrets.VERCEL_TOKEN }}
    …
    vercel-args: >-
      --env "MY_VAR=${{ secrets.VAR_WITH_SPACES }}"

(Wrap the full "NAME=VALUE" in quotes).