Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/actionify/src/types.ts>GitHubContextItem

Create and manage your GitHub workflows with TypeScript and Deno.
Latest
interface GitHubContextItem
import { type GitHubContextItem } from "https://deno.land/x/actionify@0.3.0/src/types.ts";

Properties

action: string

The name of the action currently running, or the id of a step. GitHub removes special characters, and uses the name __run when the current step runs a script without an id. If you use the same action more than once in the same job, the name will include a suffix with the sequence number with underscore before it. For example, the first script you run will have the name __run, and the second script will be named __run_2. Similarly, the second invocation of actions/checkout will be actionscheckout2.

action_path: string

The path where an action is located. This property is only supported in composite actions. You can use this path to access files located in the same repository as the action.

action_ref: string

For a step executing an action, this is the ref of the action being executed. For example, v2.

action_repository: string

For a step executing an action, this is the owner and repository name of the action. For example, actions/checkout.

action_status: string

For a composite action, the current result of the composite action.

actor: string

The username of the user that triggered the initial workflow run. If the workflow run is a re-run, this value may differ from github.triggering_actor. Any workflow re-runs will use the privileges of github.actor, even if the actor initiating the re-run (github.triggering_actor) has different privileges.

api_url: string

The URL of the GitHub REST API.

base_ref: string

The base_ref or target branch of the pull request in a workflow run. This property is only available when the event that triggers a workflow run is either pull_request or pull_request_target.

env: string

Path on the runner to the file that sets environment variables from workflow commands. This file is unique to the current step and is a different file for each step in a job. For more information, see "Workflow commands for GitHub Actions."

The full event webhook payload. You can access individual properties of the event using this context. This object is identical to the webhook payload of the event that triggered the workflow run, and is different for each event. The webhooks for each GitHub Actions event is linked in "Events that trigger workflows." For example, for a workflow run triggered by the push event, this object contains the contents of the push webhook payload.

event_name: Event

The name of the event that triggered the workflow run.

event_path: string

The path to the file on the runner that contains the full event webhook payload.

graphql_url: string

The URL of the GitHub GraphQL API.

head_ref: string

The head_ref or source branch of the pull request in a workflow run. This property is only available when the event that triggers a workflow run is either pull_request or pull_request_target.

job: string

The job_id of the current job.

Note: This context property is set by the Actions runner, and is only available within the execution steps of a job. Otherwise, the value of this property will be null.

ref: string

The branch or tag ref that triggered the workflow run. For workflows triggered by push, this is the branch or tag ref that was pushed. For workflows triggered by pull_request, this is the pull request merge branch. For workflows triggered by release, this is the release tag created. For other triggers, this is the branch or tag ref that triggered the workflow run. This is only set if a branch or tag is available for the event type. The ref given is fully-formed, meaning that for branches the format is refs/heads/<branch_name>, for pull requests it is refs/pull/<pr_number>/merge, and for tags it is refs/tags/<tag_name>. For example, refs/heads/feature-branch-1.

ref_name: string

The branch or tag name that triggered the workflow run.

ref_protected: string

true if branch protections are configured for the ref that triggered the workflow run.

ref_type: string

The type of ref that triggered the workflow run. Valid values are branch or tag.

path: string

Path on the runner to the file that sets system PATH variables from workflow commands. This file is unique to the current step and is a different file for each step in a job. For more information, see "Workflow commands for GitHub Actions."

repository: string

The owner and repository name. For example, Codertocat/Hello-World.

repository_owner: string

The repository owner's name. For example, Codertocat.

repositoryUrl: string

The Git URL to the repository. For example, git://github.com/codertocat/hello-world.git.

retention_days: string

The number of days that workflow run logs and artifacts are kept.

run_id: string

A unique number for each workflow run within a repository. This number does not change if you re-run the workflow run.

run_number: string

A unique number for each run of a particular workflow in a repository. This number begins at 1 for the workflow's first run, and increments with each new run. This number does not change if you re-run the workflow run.

run_attempt: string

A unique number for each attempt of a particular workflow run in a repository. This number begins at 1 for the workflow run's first attempt, and increments with each re-run.

server_url: string

The URL of the GitHub server. For example: https://github.com.

sha: string

The commit SHA that triggered the workflow. The value of this commit SHA depends on the event that triggered the workflow. For more information, see "Events that trigger workflows." For example, ffac537e6cbbf934b08745a378932722df287a53.

token: string

A token to authenticate on behalf of the GitHub App installed on your repository. This is functionally equivalent to the GITHUB_TOKEN secret. For more information, see "Automatic token authentication."

Note: This context property is set by the Actions runner, and is only available within the execution steps of a job. Otherwise, the value of this property will be null.

triggering_actor: string

The username of the user that initiated the workflow run. If the workflow run is a re-run, this value may differ from github.actor. Any workflow re-runs will use the privileges of github.actor, even if the actor initiating the re-run (github.triggering_actor) has different privileges.

workflow: string

The name of the workflow. If the workflow file doesn't specify a name, the value of this property is the full path of the workflow file in the repository.

workspace: string

The default working directory on the runner for steps, and the default location of your repository when using the checkout action.