0.1.2 • Published 5 years ago

github-action-meta v0.1.2

Weekly downloads
38
License
MIT
Repository
-
Last release
5 years ago

github-action-meta

Effortlessly access useful metadata from the GitHub Actions environment in Node:

const meta = require('github-action-meta')
console.log(JSON.stringify(meta, null, 2))

Keys

getterrelevant env var(s)notes
.actionGITHUB_ACTIONThe label of the currently running action, as set in main.workflow
.actorGITHUB_ACTORThe GitHub username of the user who initiated the action
.event.nameGITHUB_EVENT_NAMEThe name of the GitHub event that triggered this run
.event.pathGITHUB_EVENT_PATHThe path to the event payload file (JSON)
.event.dataGITHUB_EVENT_PATHThe event payload parsed as JSON
.git.refGITHUB_REFThe git ref, e.g. refs/heads/{branch}
.git.branchGITHUB_REFThe git ref minus the refs/heads/ prefix
.git.shaGITHUB_SHAThe (long) SHA of the current commit
.repo.slugGITHUB_REPOSITORYThe repo "slug" in the form {owner}/{name}
.repo.ownerGITHUB_REPOSITORYThe first part of the repo slug, e.g. foo in foo/bar
.repo.nameGITHUB_REPOSITORYThe second part of the repo slug, e.g. bar in foo/bar
.workflowGITHUB_WORKFLOWThe label of the currently running workflow in main.workflow
.workspaceGITHUB_WORKSPACEThe path to the repo checkout, i.e. /github/workspace