Smart resolution of git details. Validates inputs, resolves SHA from ref, and outputs comprehensive metadata.
| 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 |
| 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 |
Resolves the repository's default branch (e.g., main or master).
- uses: Appegy/git-context-action@v1id: git-contextwith:
repository: ${{ github.repository }}token: ${{ secrets.GITHUB_TOKEN }}Resolves a specific branch. Fails if the branch does not exist.
- uses: Appegy/git-context-action@v1with:
repository: ${{ github.repository }}token: ${{ secrets.GITHUB_TOKEN }}branch: 'feature/my-branch'Resolves details for a specific commit SHA.
- uses: Appegy/git-context-action@v1with:
repository: ${{ github.repository }}token: ${{ secrets.GITHUB_TOKEN }}sha: 'a1b2c3d4e5f6...'Resolves a specific git reference (tag or branch).
- uses: Appegy/git-context-action@v1with:
repository: ${{ github.repository }}token: ${{ secrets.GITHUB_TOKEN }}ref: 'refs/tags/v1.0.0'Manually override the ref_name output, useful for custom workflows.
- uses: Appegy/git-context-action@v1with:
repository: ${{ github.repository }}token: ${{ secrets.GITHUB_TOKEN }}ref_name: 'custom-release-name'