- Notifications
You must be signed in to change notification settings - Fork262
feat(cmd-version): add automatic repository un-shallowing to version workflow#1366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
codejedi365 merged 6 commits intopython-semantic-release:masterfromcodejedi365:feat/unshallow-repo-automaticallyNov 9, 2025
+515 −126
Merged
Changes fromall commits
Commits
Show all changes
6 commits Select commitHold shift + click to select a range
5ec5756 test(gitproject): refactor verify_upstream tests to use common mockin…
codejedi365ae1a88e test(cmd-version): add E2E test cases to verify automatic un-shallowi…
codejedi365e0ea112 feat(cmd-version): add automatic repository un-shallowing to version …
codejedi3658f402d3 test(gitproject): add unit tests to exercise the auto-unshallow use &…
Copilota54c6eb docs(github-actions): update example to remove need to specify repo c…
codejedi365f06e780 docs(uv-integration): update example to remove need to specify repo c…
codejedi365File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
26 changes: 14 additions & 12 deletionsdocs/configuration/automatic-releases/github-actions.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -875,17 +875,16 @@ to the GitHub Release Assets as well. | ||
| contents: write | ||
| steps: | ||
| # Note: We checkout the repository at the branch that triggered the workflow. | ||
| #Python Semantic Release will automatically convert shallow clones to full clones | ||
| #if needed to ensure properhistory evaluation. However, we forcefully reset the | ||
| # branch to the workflow sha because it is possible that the branch was updated | ||
| #whiletheworkflow wasrunning, which prevents accidentally releasing un-evaluated | ||
| # changes. | ||
| - name: Setup | Checkout Repository on Release Branch | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ github.ref_name }} | ||
| - name: Setup | Force release branch to be at workflow sha | ||
| run: | | ||
| @@ -959,11 +958,6 @@ to the GitHub Release Assets as well. | ||
| one release job in the case if there are multiple pushes to ``main`` in a short period | ||
| of time. | ||
| .. warning:: | ||
| The ``GITHUB_TOKEN`` secret is automatically configured by GitHub, with the | ||
| same permissions role as the user who triggered the workflow run. This causes | ||
| @@ -974,6 +968,14 @@ to the GitHub Release Assets as well. | ||
| case, you will also need to pass the new token to ``actions/checkout`` (as | ||
| the ``token`` input) in order to gain push access. | ||
| .. note:: | ||
| As of $NEW_RELEASE_TAG, Python Semantic Release automatically detects and converts | ||
codejedi365 marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| shallow clones to full clones when needed. While you can still use ``fetch-depth: 0`` | ||
| with ``actions/checkout@v4`` to fetch the full history upfront, it is no longer | ||
| required. If you use the default shallow clone, Python Semantic Release will | ||
| automatically fetch the full history before evaluating commits. If you are using | ||
| an older version of PSR, you will need to unshallow the repository prior to use. | ||
| .. note:: | ||
| As of $NEW_RELEASE_TAG, the verify upstream step is no longer required as it has been | ||
| integrated into PSR directly. If you are using an older version of PSR, you will need | ||
2 changes: 0 additions & 2 deletionsdocs/configuration/configuration-guides/uv_integration.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
17 changes: 11 additions & 6 deletionssrc/semantic_release/cli/commands/version.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletionssrc/semantic_release/gitproject.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.