Variables, Secrets, Contexts, and Expressions
AtomGit Action provides a four-level variable system: env, vars, secrets, and inputs, achieving flexible workflow configuration through contexts (core is atomgit) and expressions (${{ expression }}).
Four-Level Variable System
| Type | Suitable for storing | Sensitive | Reference method |
|---|---|---|---|
env | Temporary variables within the workflow | No | $VAR_NAME or ${{ env.VAR }} |
vars | General variables at repository/organization level | No | ${{ vars.VAR }} |
secrets | Passwords, tokens, private keys | Yes | ${{ secrets.NAME }} |
inputs | Workflow input parameters | No | ${{ inputs.NAME }} |
Variable Priority
Step env > Job env > Workflow env
Contexts
AtomGit Action supports 12 contexts, with the core context named atomgit:
| Context | Description | Typical Properties |
|---|---|---|
atomgit | Core information of the workflow run | atomgit.sha, atomgit.ref, atomgit.event_name |
env | Environment variables | env.VAR_NAME |
vars | Configuration variables | vars.VAR_NAME |
secrets | Secrets | secrets.NAME |
job | Current job information | job.status |
steps | Step information and outputs | steps.id.outputs.result |
runner | Runner information | runner.os, runner.arch |
inputs | Input parameters | inputs.NAME |
matrix | Matrix parameters | matrix.os |
strategy | Matrix strategy information | strategy.fail-fast |
Expressions
Expressions are embedded in YAML values using the ${{ expression }} syntax:
Operators: ==, !=, !, &&, ||
Status Functions:
| Function | Description |
|---|---|
success | Previous steps succeeded |
always | Execute regardless of success or failure |
cancelled | Workflow was cancelled |
failed | Previous steps failed |
String Functions: contains, startsWith, endsWith, format, substring, replace
Special Functions: hashFiles, toJson