Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ jobs:
# that bypassed dry-run would be denied by the API.
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- id: semvertag
uses: ./
with:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/semvertag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: ./
with:
dry-run: true
Expand Down
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,12 @@ jobs:
tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: modern-python/semvertag@v0
```

semvertag auto-detects GitHub Actions, picks the bump from the latest
commit, and creates the tag ref via the GitHub API. `fetch-depth: 0`
matters — the default `1` misses tag-relative history. See
commit, and creates the tag ref via the GitHub API. It never reads the
working tree, so the job needs no `actions/checkout` step at all. See
[GitHub Actions docs](https://github.com/modern-python/semvertag/blob/main/docs/providers/github.md) for token scopes,
GitHub Enterprise setup, outputs, and troubleshooting.

Expand Down
18 changes: 5 additions & 13 deletions docs/providers/github.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ jobs:
tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: modern-python/semvertag@v0
```

Expand All @@ -49,10 +46,11 @@ without pushing.
> `--provider github` is only needed when running outside GHA (e.g.
> on a developer laptop targeting a github.com repo).

> **`fetch-depth: 0`** matters: semvertag walks commit history to
> determine the bump. `actions/checkout@v4`'s default
> `fetch-depth: 1` only fetches the single tip commit and will miss
> tag-relative history.
> **No checkout needed.** semvertag reads the head commit and the tag
> history over the GitHub API and never touches the working tree, so
> the job needs neither an `actions/checkout` step nor a `fetch-depth`
> setting. Add a checkout only if other steps in the same job need the
> repository files.

## Strategy

Expand Down Expand Up @@ -113,9 +111,6 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- id: semvertag
uses: modern-python/semvertag@v0
- if: steps.semvertag.outputs.status == 'created'
Expand Down Expand Up @@ -223,9 +218,6 @@ jobs:
tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.13"
Expand Down
Loading