Skip to content

Instantly share code, notes, and snippets.

@robherley
Created October 15, 2025 01:20
Show Gist options
  • Select an option

  • Save robherley/af431e88516a0f7632bd2428ecd981fe to your computer and use it in GitHub Desktop.

Select an option

Save robherley/af431e88516a0f7632bd2428ecd981fe to your computer and use it in GitHub Desktop.
GitHub Actions Events

GitHub Actions Events by SHA and Ref

  • Default branch events: branch_protection_rule, check_run, check_suite, delete, discussion, discussion_comment, fork, gollum, issue_comment, issues, label, milestone, page_build, public, repository_dispatch, schedule, status, watch, workflow_run
  • Non-default branch events: create, deployment, deployment_status, merge_group, pull_request, pull_request_review, pull_request_review_comment, pull_request_target, push, registry_package, release, workflow_call, workflow_dispatch
Name GITHUB_SHA GITHUB_REF Default Branch Event?
branch_protection_rule Last commit on default branch Default branch
check_run Last commit on default branch Default branch
check_suite Last commit on default branch Default branch
create Last commit on the created branch or tag Branch or tag created
delete Last commit on default branch Default branch
deployment Commit to be deployed Branch or tag to be deployed (empty if created with a commit SHA)
deployment_status Commit to be deployed Branch or tag to be deployed (empty if commit)
discussion Last commit on default branch Default branch
discussion_comment Last commit on default branch Default branch
fork Last commit on default branch Default branch
gollum Last commit on default branch Default branch
issue_comment Last commit on default branch Default branch
issues Last commit on default branch Default branch
label Last commit on default branch Default branch
merge_group SHA of the merge group Ref of the merge group
milestone Last commit on default branch Default branch
page_build Last commit on default branch Default branch
public Last commit on default branch Default branch
pull_request Last merge commit on the GITHUB_REF branch PR merge branch refs/pull/PULL_REQUEST_NUMBER/merge
pull_request_review Last merge commit on the GITHUB_REF branch PR merge branch refs/pull/PULL_REQUEST_NUMBER/merge
pull_request_review_comment Last merge commit on the GITHUB_REF branch PR merge branch refs/pull/PULL_REQUEST_NUMBER/merge
pull_request_target Last commit on the PR base branch PR base branch
push Tip commit pushed to the ref. When you delete a branch, the SHA in the workflow run (and its associated refs) reverts to the default branch of the repository. Updated ref
registry_package Commit of the published package Branch or tag of the published package
release Last commit in the tagged release Tag ref of release refs/tags/<tag_name>
repository_dispatch Last commit on default branch Default branch
schedule Last commit on default branch Default branch
status Last commit on default branch Default branch
watch Last commit on default branch Default branch
workflow_call Same as the caller workflow Same as the caller workflow
workflow_dispatch Last commit on the GITHUB_REF branch or tag Branch or tag that received dispatch
workflow_run Last commit on default branch Default branch
let events = [...document.querySelectorAll('h2 + table > tbody > tr')].map(e => {
let [sha, ref] = [e.childNodes[2].innerText, e.childNodes[3].innerText];
let event = e.closest('table').ariaLabelledByElements[0].innerText;
return {event, sha, ref, default: ref == "Default branch" ? "✅" : ""};
});
let summary = `## GitHub Actions Events by SHA and Ref
- Default branch events: ${events.filter(e => e.default).map(e => `\`${e.event}\``).join(", ")}
- Non-default branch events: ${events.filter(e => !e.default).map(e => `\`${e.event}\``).join(", ")}
| Name | \`GITHUB_SHA\` | \`GITHUB_REF\` | Default Branch Event? |
| - | - | - | - |
${events.map(e => [`[\`${e.event}\`](https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#${e.event})`, e.sha, e.ref, e.default].join(' | ')).map(e => `| ${e} |`).join('\n')}
`;
console.log(summary);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment