Skip to content

Use this Github Action to update a variable in your Github Action Workflows for your repository

License

Notifications You must be signed in to change notification settings

mmoyaferrer/set-github-variable

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

📦

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

About

Use this Github Action to update a variable in your Github Action Workflows for your repository

Resources

License

Stars

Watchers

Forks

Packages

No packages published