Skip to content

Set Github Variable

Actions
Update variables for github repository/org
v1.0.0
Latest
Star (7)
📦

set-github-variable

A GitHub Action for updating Github Variables


Usage

Updates Github Variable for a repository or organization.

- uses: mmoyaferrer/set-github-variable@v1.0.0
  with:
      name: 'SAMPLE_VAR'
      value: 'Hello World'
      repository: mmoyaferrer/set-github-variable
      token: ${{ secrets.REPO_ACCESS_TOKEN }}

Pre-requisites

  1. Create a Github Variable for your repo/organization.
  2. Create an access token with access to manage actions repository variables.

It does not require to do checkout and it's independent on the Github runner/docker container used.

Customizing

inputs

The following are required

Name Type Description
name String Variable name
value String Variable value
repository String Repository name, with format <organization>/<repository> i.e mmoyaferrer/set-github-variable
token String Repository Token

The following are optional, to be provided when the value is Org scoped instead of a repository variable:

Name Type Description
org Boolean Details if the variable belongs to an organization (default is false)
visibility String Configures access to the repositorys in the org, see more
selectedRepositoryIds String[Integer] Array of repositories ids where to update the org-scoped variable, see more

outputs

The following outputs can be accessed via ${{ steps.<step-id>.outputs }} from this action

Name Type Description
data String Response data from Github API
status Integer Response code from Github API

Set Github Variable 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

Update variables for github repository/org
v1.0.0
Latest

Set Github Variable 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.