Skip to content

A GitHub Action that ensures certain environment variables are set in Vercel

License

Notifications You must be signed in to change notification settings

Liodene/vercel-set-env-action

 
 

Repository files navigation

Vercel Set Env Action

This GitHub Action sets Environment Variables inside Vercel based on inputs.

Usage

All keys in envVariableKeys must be matched by all 3: The key, and the key prefixed with TARGET_ and TYPE_.

jobs:
  set-env-vars:
    runs-on: ubuntu-latest
    steps:
      - name: Set Env Vars on Vercel Project
        uses: dkershner6/vercel-set-env-action@v1
        with:
          token: ${{ secrets.VERCEL_API_TOKEN }}
          teamId: ${{ secrets.VERCEL_TEAM_ID }} # optional, without will use personal
          projectName: vercel-env-setter # project name in Vercel
          envVariableKeys: ENV_VAR1,ENV_VAR2,ENV_VAR3
        env:
          ENV_VAR1: myEnvVar1
          TARGET_ENV_VAR1: production # comma delimited, one of [production, preview, development]
          TYPE_ENV_VAR1: encrypted # one of [plain, encrypted]
          ENV_VAR2: envVar2Value
          TARGET_ENV_VAR2: preview,development
          TYPE_ENV_VAR2: plain
          ENV_VAR3: envVar3Value
          TARGET_ENV_VAR3: preview
          TYPE_ENV_VAR3: plain
          GIT_BRANCH_ENV_VAR3: feature/foo

About

A GitHub Action that ensures certain environment variables are set in Vercel

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 99.1%
  • JavaScript 0.9%