From addf5bf970baa56bd049c695bea25bbd8e67d483 Mon Sep 17 00:00:00 2001 From: Vincent Giersch Date: Thu, 10 Sep 2026 17:47:35 +0200 Subject: [PATCH] fix(docs): close the async code fence, and give each tag a GitHub release Two escapes in the README were written as the literal characters \n rather than newlines, so the asynchronous usage fence neither opened nor closed. On PyPI every section after it, supported versions, documentation links, provenance verification and the maintenance notes, rendered inside the code block. Visible at https://pypi.org/project/flat-api/2.0.0/ Checked the rest: all twelve fences in the README now pair up, none carry an escape, and no other markdown file in this repository or the other three clients has the same problem. Publishing also now creates a GitHub release for the tag rather than leaving it bare. A tag on its own tells a reader nothing and notifies nobody; a release carries the version's changelog section and reaches anyone watching this repository. The notes are extracted from CHANGELOG.md by heading, falling back to a pointer at the file when a version has no section. This needs contents: write, which the workflow did not have. --- .github/workflows/release.yml | 19 ++++++++++++++++++- CHANGELOG.md | 6 ++++++ README.md | 6 ++++-- VERSION | 2 +- 4 files changed, 29 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 10e8d24..ec4e18d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,7 +9,7 @@ on: tags: ['[0-9]+.[0-9]+.[0-9]+'] permissions: - contents: read + contents: write # create the GitHub release for the tag id-token: write # OIDC for PyPI trusted publishing and provenance (FR-021a, FR-021b) jobs: @@ -48,3 +48,20 @@ jobs: uses: pypa/gh-action-pypi-publish@release/v1 with: attestations: true + + # A bare tag tells a reader nothing. This gives the version a page carrying its changelog + # section, and it is what a watcher of this repository is notified about. + - name: Publish the GitHub release + env: + GH_TOKEN: ${{ github.token }} + run: | + TAG="${GITHUB_REF_NAME}" + NOTES="$(awk -v tag="$TAG" ' + $0 ~ "^## \\[?" tag {found=1; next} + found && /^## / {exit} + found {print} + ' CHANGELOG.md)" + [ -n "$NOTES" ] || NOTES="See CHANGELOG.md for the changes in $TAG." + printf '%s\n\n---\n\nInstall: `pip install flat-api==%s`\n' "$NOTES" "$TAG" \ + > /tmp/notes.md + gh release create "$TAG" --title "$TAG" --notes-file /tmp/notes.md --verify-tag diff --git a/CHANGELOG.md b/CHANGELOG.md index f9b3d41..700abe3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [2.0.1](https://github.com/FlatIO/api-client-python/compare/2.0.0...2.0.1) (2026-09-10) + +### Bug Fixes + +* **docs:** close the asynchronous usage code fence in the README. Two escapes had been written as the literal characters `\n` rather than newlines, so the fence never opened or closed and every section after it rendered inside the code block on PyPI. + ## [1.1.3](https://github.com/FlatIO/api-client-python/compare/v1.1.2...v1.1.3) (2024-03-08) diff --git a/README.md b/README.md index 1f73e49..a079da4 100644 --- a/README.md +++ b/README.md @@ -52,10 +52,12 @@ except FlatNotFoundError: ### Asynchronous use -```python\nfrom flat_api import AsyncFlatClient +```python +from flat_api import AsyncFlatClient client = AsyncFlatClient(access_token="YOUR_TOKEN") -# every operation is awaitable\n``` +# every operation is awaitable +``` ## Supported versions diff --git a/VERSION b/VERSION index 227cea2..38f77a6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.0.0 +2.0.1