Skip to content

Document how to find the equivalent of github.sha in other events than push #30093

@asbjornu

Description

@asbjornu

Code of Conduct

What article on docs.github.com is affected?

What part(s) of the article would you like to see updated?

The information around github.sha and GITHUB_SHA.

Additional information

As discussed in #15302, finding the equivalent of github.sha in events other than push is a bit unclear.

Although the clarification in #15482 is welcome, it only clarifies what GITHUB_SHA will represent, not how to find an equivalent value in different events and contexts.

It would be nice if it were more clearly documented that for pull_request runs, the equivalent to github.sha is github.event.pull_request.head.sha, and for workflow_run it is github.event.workflow_run.head_sha. There's probably other events that should have this clarified as well, but those are the two I've stumbled upon during my development.

(Created by the request of @cmwilson21 in #15302 (comment))

Metadata

Metadata

Assignees

No one assigned

    Labels

    actionsThis issue or pull request should be reviewed by the docs actions teamcontentThis issue or pull request belongs to the Docs Content teamstaleThere is no recent activity on this issue or pull requestwaiting for reviewIssue/PR is waiting for a writer's review

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions