diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f4ebb9d..2a63931 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: diff --git a/.github/workflows/semvertag.yml b/.github/workflows/semvertag.yml index 366824e..630abae 100644 --- a/.github/workflows/semvertag.yml +++ b/.github/workflows/semvertag.yml @@ -30,8 +30,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - with: - fetch-depth: 0 - uses: ./ with: dry-run: true diff --git a/README.md b/README.md index f996bc3..94dbb7c 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/docs/providers/github.md b/docs/providers/github.md index 4d50c7c..2182b61 100644 --- a/docs/providers/github.md +++ b/docs/providers/github.md @@ -32,9 +32,6 @@ jobs: tag: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - uses: modern-python/semvertag@v0 ``` @@ -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 @@ -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' @@ -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"