Skip to content

Resolves complete git reference information from a repository.

License

Notifications You must be signed in to change notification settings

Appegy/git-context-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Git Context Action

Smart resolution of git details. Validates inputs, resolves SHA from ref, and outputs comprehensive metadata.

Inputs

Input Description Required
repository Repository in format owner/repo Yes
token GitHub token with repo access Yes
branch Branch name. If provided, verified against SHA/Ref. No
sha Commit SHA. If provided, used as verification target. No
ref Git ref (e.g., refs/heads/main). If provided, verified. No
ref_name Reference name override No

Outputs

Output Description
sha Full commit SHA (40 characters)
sha_short Short commit SHA (7 characters)
ref Full git reference
ref_name Reference name without prefix
branch Branch name (if resolved)
tags Comma-separated list of tags
tag First tag pointing to this commit
commit_message Commit message (first line)
commit_message_full Full commit message
author_name Author Name
author_email Author Email
author_date Author Date
committer_name Committer Name
committer_email Committer Email
committer_date Committer Date

Usage

Default (Auto-detect Default Branch)

Resolves the repository's default branch (e.g., main or master).

- uses: Appegy/git-context-action@v1
  id: git-context
  with:
    repository: ${{ github.repository }}
    token: ${{ secrets.GITHUB_TOKEN }}

Specific Branch

Resolves a specific branch. Fails if the branch does not exist.

- uses: Appegy/git-context-action@v1
  with:
    repository: ${{ github.repository }}
    token: ${{ secrets.GITHUB_TOKEN }}
    branch: 'feature/my-branch'

Specific SHA

Resolves details for a specific commit SHA.

- uses: Appegy/git-context-action@v1
  with:
    repository: ${{ github.repository }}
    token: ${{ secrets.GITHUB_TOKEN }}
    sha: 'a1b2c3d4e5f6...'

Specific Tag (Ref)

Resolves a specific git reference (tag or branch).

- uses: Appegy/git-context-action@v1
  with:
    repository: ${{ github.repository }}
    token: ${{ secrets.GITHUB_TOKEN }}
    ref: 'refs/tags/v1.0.0'

Override Reference Name

Manually override the ref_name output, useful for custom workflows.

- uses: Appegy/git-context-action@v1
  with:
    repository: ${{ github.repository }}
    token: ${{ secrets.GITHUB_TOKEN }}
    ref_name: 'custom-release-name'

About

Resolves complete git reference information from a repository.

Resources

License

Stars

Watchers

Forks

Packages

No packages published