Skip to content

Env set

Actions

About

Set environment variable in GitHub Actions
v1.1
Latest
Star (0)

envset GitHub Action

main release

This action sets an environment variable in GitHub Actions workflow. It is useful when you want to set an environment variable that may contain double or single quotes, and you don't know the value in advance.

Action writes into a GITHUB_ENV file, so the environment variable will be available in the next steps of the same job. It's equivalent to echo "SOME_VARIABLE=$SOME_VALUE" >> $GITHUB_ENV, but less error-prone in case value contains quotes.

This is a Docker-based action, so it may not work on Windows and MacOS runners.

Inputs

Name Description Required
name Environment variable name true
value Environment variable value true

Usage

name: dispatch

on:
  workflow_dispatch:
    inputs:
      some_value:
        description: Some value
        required: true

dispatch:
  pull:
    runs-on: ubuntu-latest
    steps:
      - name: Set environment variable
        uses: alsosee/envset@v1
        with:
          name: SOME_VARIABLE
          value: ${{ github.event.inputs.some_value }}

      ...

Env set is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Set environment variable in GitHub Actions
v1.1
Latest

Env set is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.