Skip to content

Commit 0979b48

Browse files
committed
update readme
1 parent aebfd65 commit 0979b48

1 file changed

Lines changed: 60 additions & 14 deletions

File tree

README.md

Lines changed: 60 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ Smart resolution of git details. Validates inputs, resolves SHA from branch/ref,
44

55
## Inputs
66

7-
| Input | Description | Required | Default |
8-
| --- | --- | --- | --- |
9-
| `repository` | Repository in format owner/repo | **Yes** | |
10-
| `token` | GitHub token with repo access | **Yes** | |
11-
| `branch` | Branch name. If provided, verified against SHA/Ref. | No | |
12-
| `sha` | Commit SHA. If provided, used as verification target. | No | |
13-
| `ref` | Git ref (e.g., refs/heads/main). If provided, verified. | No | |
14-
| `ref_name` | Reference name override | No | |
7+
| Input | Description | Required |
8+
| --- | --- | --- |
9+
| `repository` | Repository in format owner/repo | **Yes** |
10+
| `token` | GitHub token with repo access | **Yes** |
11+
| `branch` | Branch name. If provided, verified against SHA/Ref. | No |
12+
| `sha` | Commit SHA. If provided, used as verification target. | No |
13+
| `ref` | Git ref (e.g., refs/heads/main). If provided, verified. | No |
14+
| `ref_name` | Reference name override | No |
1515

1616
## Outputs
1717

@@ -35,11 +35,57 @@ Smart resolution of git details. Validates inputs, resolves SHA from branch/ref,
3535

3636
## Usage
3737

38+
### Default (Auto-detect Default Branch)
39+
Resolves the repository's default branch (e.g., `main` or `master`).
40+
41+
```yaml
42+
- uses: Appegy/git-context-action@v1
43+
id: git-context
44+
with:
45+
repository: ${{ github.repository }}
46+
token: ${{ secrets.GITHUB_TOKEN }}
47+
```
48+
49+
### Specific Branch
50+
Resolves a specific branch. Fails if the branch does not exist.
51+
52+
```yaml
53+
- uses: Appegy/git-context-action@v1
54+
with:
55+
repository: ${{ github.repository }}
56+
token: ${{ secrets.GITHUB_TOKEN }}
57+
branch: 'feature/my-branch'
58+
```
59+
60+
### Specific SHA
61+
Resolves details for a specific commit SHA.
62+
63+
```yaml
64+
- uses: Appegy/git-context-action@v1
65+
with:
66+
repository: ${{ github.repository }}
67+
token: ${{ secrets.GITHUB_TOKEN }}
68+
sha: 'a1b2c3d4e5f6...'
69+
```
70+
71+
### Specific Tag (Ref)
72+
Resolves a specific git reference (tag or branch).
73+
74+
```yaml
75+
- uses: Appegy/git-context-action@v1
76+
with:
77+
repository: ${{ github.repository }}
78+
token: ${{ secrets.GITHUB_TOKEN }}
79+
ref: 'refs/tags/v1.0.0'
80+
```
81+
82+
### Override Reference Name
83+
Manually override the `ref_name` output, useful for custom workflows.
84+
3885
```yaml
39-
steps:
40-
- uses: actions/checkout@v4
41-
- uses: ./
42-
with:
43-
repository: ${{ github.repository }}
44-
token: ${{ secrets.GITHUB_TOKEN }}
86+
- uses: Appegy/git-context-action@v1
87+
with:
88+
repository: ${{ github.repository }}
89+
token: ${{ secrets.GITHUB_TOKEN }}
90+
ref_name: 'custom-release-name'
4591
```

0 commit comments

Comments
 (0)