Context
AtomGit Action provides 12 contexts to access runtime environment information in workflows. Each context is a JSON object that can be accessed using the expression ${{ context.property }}.
2.1 Overview of Contexts
| Context | Description | Common Access Methods |
|---|---|---|
atomgit | AtomGit platform and event information | ${{ atomgit.event_name }}, ${{ atomgit.sha }} |
env | Custom environment variables for the current step/Job/Workflow | ${{ env.MY_VAR }} |
vars | Organization/project level configuration variables | ${{ vars.DEPLOY_ENV }} |
job | Current Job information | ${{ job.status }} |
jobs | Results of previously run Jobs in a reusable workflow | ${{ jobs.deploy.result }} |
steps | Information about each step in the current Job | ${{ steps.build.outputs.result }} |
runner | Runner execution environment information | ${{ runner.os }}, ${{ runner.arch }} |
secrets | Encrypted secrets | ${{ secrets.DEPLOY_TOKEN }} |
strategy | Matrix strategy information | ${{ strategy.job-index }} |
matrix | Variable values of the current matrix instance | ${{ matrix.version }} |
inputs | Input parameters for workflow_dispatch/workflow_call | ${{ inputs.environment }} |
2.2 Full Properties of atomgit Context
atomgit is the core context specific to AtomGit, providing all information related to the platform and events.
| Property | Type | Description |
|---|---|---|
atomgit.event_name | string | Name of the current triggering event |
atomgit.sha | string | SHA of the triggering commit |
atomgit.ref | string | Triggered reference (full name of branch or tag, e.g., refs/heads/main) |
atomgit.ref_name | string | Short name of the triggered reference (e.g., main, v1.0) |
atomgit.ref_type | string | Reference type: branch or tag |
atomgit.event | object | Full payload object of the event |
atomgit.workspace | string | Path to the Runner workspace |
atomgit.action | string | Name of the current Action |
atomgit.token | string | ATOMGIT_TOKEN token (used for API calls) |
atomgit.repository | string | Full name of the repository (e.g., owner/repo) |
atomgit.repository_owner | string | Organization/user name of the repository |
atomgit.repositoryUrl | string | Repository URL |
atomgit.run_id | string | Unique ID of the workflow run |
atomgit.run_number | number | Workflow run number |
atomgit.run_attempt | number | Number of workflow retries |
atomgit.workflow | string | Workflow name |
atomgit.head_ref | string | PR source branch (only for PR events) |
atomgit.base_ref | string | PR target branch (only for PR events) |
atomgit.server_url | string | Root URL of the AtomGit platform |
atomgit.api_url | string | Base URL of the AtomGit API |
2.3 Event Fields of atomgit.event
push event
| Field | Description |
|---|---|
atomgit.event.ref | Full ref of the push |
atomgit.event.before | SHA before the push |
atomgit.event.after | SHA after the push |
atomgit.event.commits | Array of commit list |
atomgit.event.commits[].id | SHA of a single commit |
atomgit.event.commits[].message | Commit message |
atomgit.event.commits[].author | Commit author |
atomgit.event.commits[].added | List of added files |
atomgit.event.commits[].modified | List of modified files |
atomgit.event.commits[].removed | List of deleted files |
atomgit.event.base_ref | Base ref (empty for tag pushes) |
atomgit.event.created | Whether it's a newly created ref |
atomgit.event.deleted | Whether it's a deleted ref |
pull_request event
| Field | Description |
|---|---|
atomgit.event.pull_request.number | PR number |
atomgit.event.pull_request.title | PR title |
atomgit.event.pull_request.body | PR description |
atomgit.event.pull_request.state | PR status (open/closed) |
atomgit.event.pull_request.user.login | PR creator |
atomgit.event.pull_request.head.ref | PR source branch name |
atomgit.event.pull_request.head.sha | Latest SHA of the PR source branch |
atomgit.event.pull_request.head.repo.full_name | Full name of the PR source repository |
atomgit.event.pull_request.base.ref | PR target branch name |
atomgit.event.pull_request.base.repo.full_name | Full name of the PR target repository |
atomgit.event.pull_request.labels | List of PR labels |
atomgit.event.pull_request.merged | Whether the PR has been merged |
atomgit.event.pull_request.draft | Whether the PR is a Draft |
atomgit.event.action | Type of PR event action |
issue_comment event
| Field | Description |
|---|---|
atomgit.event.comment.id | Comment ID |
atomgit.event.comment.body | Comment content |
atomgit.event.comment.user.login | Commenter |
atomgit.event.comment.created_at | Comment creation time |
atomgit.event.issue.number | Issue number |
atomgit.event.issue.title | Issue title |
atomgit.event.issue.state | Issue status |
atomgit.event.issue.pull_request | Whether it's a PR comment (exists if it's a PR) |
atomgit.event.action | Action type |