You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
GitHub Action
Set Github Variable by Open Foxes
v1.2.1
📦
A GitHub Action for updating Github Variables
Updates Github Variable for a repository or organization.
- uses: openfoxes/set-github-variable@v1.2.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.
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 |
logOldValue |
Boolean | Enables/Disables logging of the previous variable value |
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 |
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 |