- Notifications
You must be signed in to change notification settings - Fork262
docs: use pinned version for GHA examples#1004
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 4 commits intopython-semantic-release:masterfromwyardley:wyardley/1003Aug 18, 2024
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
4 commits Select commitHold shift + click to select a range
e4e3341 docs: use pinned version for GHA examples
wyardley5d217c6 chore(scripts): add auto version bump to non dynamic docs text (i.e. …
codejedi365e5036dc docs(github-actions): adjust formatting & version warning in code sni…
codejedi365f94eb75 style(docs-github-actions): adjust formatting for readability
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
64 changes: 33 additions & 31 deletionsdocs/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
4 changes: 3 additions & 1 deletiondocs/github-action.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
1 change: 1 addition & 0 deletionspyproject.toml
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
Empty file addedscripts/__init__.py
Empty file.
36 changes: 36 additions & 0 deletionsscripts/bump_version_in_docs.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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # ruff: noqa: T201, allow print statements in non-prod scripts | ||
| from __future__ import annotations | ||
| from os import getenv | ||
| from pathlib import Path | ||
| from re import compile as RegExp # noqa: N812 | ||
| PROJ_DIR = Path(__file__).resolve().parent.parent | ||
| DOCS_DIR = PROJ_DIR / "docs" | ||
| def update_github_actions_example(filepath: Path, new_version: str) -> None: | ||
| psr_regex = RegExp(r"(uses:.*python-semantic-release)@v\d+\.\d+\.\d+") | ||
| file_content_lines = filepath.read_text().splitlines() | ||
| for regex in [psr_regex]: | ||
| file_content_lines = list(map( | ||
| lambda line, regex=regex: regex.sub(r'\1@v'+new_version, line), | ||
| file_content_lines | ||
| )) | ||
| print(f"Bumping version in {filepath} to", new_version) | ||
| filepath.write_text(str.join("\n", file_content_lines) + '\n') | ||
| if __name__ == "__main__": | ||
| new_version = getenv("NEW_VERSION") | ||
| if not new_version: | ||
| print("NEW_VERSION environment variable is not set") | ||
| exit(1) | ||
| update_github_actions_example(DOCS_DIR / "github-action.rst", new_version) | ||
| update_github_actions_example( | ||
| DOCS_DIR / "automatic-releases" / "github-actions.rst", | ||
| new_version | ||
| ) |
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.