GitHub Action
Set Github Variable by Open Foxes
A GitHub Action for updating Github Variables
Version 1.4.0
With this Github Action you are able to modify Repository Variables right from your Github Workflow. It is very easy to integrate in your project, just take a look at the "Usage"-section.
Updates Github Variable for a repository or organization.
- uses: openfoxes/set-github-variable@v1.4.0
with:
name: 'SAMPLE_VAR'
value: 'Hello World'
repository: openfoxes/set-github-variable
token: ${{ secrets.REPO_ACCESS_TOKEN }}
- Create a Github Variable for your repo/organization.
- 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.
Inputs marked as "Required" must be set.
Name | Type | Required | Default | Description |
---|---|---|---|---|
name |
String | Yes | Variable name | |
value |
String | Yes | Variable value | |
repository |
String | Yes | Repository name, with format <organization>/<repository> i.e openfoxes/set-github-variable |
|
token |
String | Yes | Repository Token | |
logLevel |
Enum [NONE/INFO/VERBOSE] | No | INFO |
Granularity of log messages. None disables the logging. |
logOldValue |
Boolean | No | true |
Enables/Disables logging of the previous variable value |
The following are 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 |
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 |
This repository is based on https://github.com/mmoyaferrer/set-github-variable. It should be kept up to date, so feel free to open issues or suggest solutions. This fork is intended as a progression on the original repository and will be developed in parallel. I will try to keep it based on the original one, if there are any updates.
This project aims to provide a clean and secure design. In order to optimize the underlying code and reducing the risk of bugs, quality tools are used: