This is a GitHub Action to update environment variable in a workflow run. If the variable does not exist in the environment, it will be created.
- name: Update Environment Variable
uses: MandalAutomations/Update-Environment-Variable@v1
with:
Name: "Name of the variable"
Value: "Value of the variable"
EnvironmentName: "Environment name"
RepoId: ${{ github.repository_id }}
Token: ${{ secrets.PAT_TOKEN }}update_environment_variable:
runs-on: ubuntu-latest
strategy:
matrix:
enviornments: ["main", "test", "uat"]
steps:
- name: Update Environment Variable
uses: MandalAutomations/Update-Environment-Variable@v6
with:
Name: "Name of the variable"
Value: "Value of the variable"
EnvironmentName: ${{ matrix.enviornments }}
RepoId: ${{ github.repository_id }}
Token: ${{ secrets.PAT_TOKEN }}Required String Name for the variable to update
Required String Value for the variable to update
Required String Environment Name
Required String Repository ID can be found using ${{ github.repository_id }}
Required String Personal Access Token (PAT)