amondnet / vercel-action

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

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

Closed wilsonpage closed 8 months ago

wilsonpage commented 1 year 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 10 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).