Browse Source

Merge branch 'master' into french-translation

pull/11963/head
Abeer Mosaad 10 months ago
committed by GitHub
parent
commit
21cefa0e25
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      .github/workflows/deploy-docs.yml
  2. 12
      .github/workflows/test-redistribute.yml
  3. 1
      docs/en/docs/css/termynal.css
  4. 5
      docs/en/docs/release-notes.md
  5. 14
      scripts/deploy_docs_status.py

2
.github/workflows/deploy-docs.yml

@ -64,10 +64,10 @@ jobs:
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ ( github.event.workflow_run.head_repository.full_name == github.repository && github.event.workflow_run.head_branch == 'master' && 'main' ) || ( github.event.workflow_run.head_sha ) }}
- name: Comment Deploy
if: steps.deploy.outputs.url != ''
run: python ./scripts/deploy_docs_status.py
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEPLOY_URL: ${{ steps.deploy.outputs.url }}
COMMIT_SHA: ${{ github.event.workflow_run.head_sha }}
RUN_ID: ${{ github.run_id }}
IS_DONE: "true"

12
.github/workflows/test-redistribute.yml

@ -55,3 +55,15 @@ jobs:
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
# https://github.com/marketplace/actions/alls-green#why
test-redistribute-alls-green: # This job does nothing and is only used for the branch protection
if: always()
needs:
- test-redistribute
runs-on: ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}

1
docs/en/docs/css/termynal.css

@ -26,6 +26,7 @@
position: relative;
-webkit-box-sizing: border-box;
box-sizing: border-box;
/* Custom line-height */
line-height: 1.2;
}

5
docs/en/docs/release-notes.md

@ -19,6 +19,9 @@ hide:
### Internal
* 💡 Add comment about custom Termynal line-height. PR [#11976](https://github.com/fastapi/fastapi/pull/11976) by [@tiangolo](https://github.com/tiangolo).
* 👷 Add alls-green for test-redistribute. PR [#11974](https://github.com/fastapi/fastapi/pull/11974) by [@tiangolo](https://github.com/tiangolo).
* 👷 Update docs-previews to handle no docs changes. PR [#11975](https://github.com/fastapi/fastapi/pull/11975) by [@tiangolo](https://github.com/tiangolo).
* 🔨 Refactor script `deploy_docs_status.py` to account for deploy URLs with or without trailing slash. PR [#11965](https://github.com/fastapi/fastapi/pull/11965) by [@tiangolo](https://github.com/tiangolo).
* 🔒️ Update permissions for deploy-docs action. PR [#11964](https://github.com/fastapi/fastapi/pull/11964) by [@tiangolo](https://github.com/tiangolo).
* 👷🏻 Add deploy docs status and preview links to PRs. PR [#11961](https://github.com/fastapi/fastapi/pull/11961) by [@tiangolo](https://github.com/tiangolo).
@ -44,7 +47,7 @@ pip install "fastapi[standard]"
* This adds support for calling the CLI as:
```bash
python -m python
python -m fastapi
```
* And it upgrades `fastapi-cli[standard] >=0.0.5`.

14
scripts/deploy_docs_status.py

@ -12,6 +12,7 @@ class Settings(BaseSettings):
deploy_url: str | None = None
commit_sha: str
run_id: int
is_done: bool = False
def main():
@ -30,10 +31,19 @@ def main():
commits = list(use_pr.get_commits())
current_commit = [c for c in commits if c.sha == settings.commit_sha][0]
run_url = f"https://github.com/{settings.github_repository}/actions/runs/{settings.run_id}"
if settings.is_done and not settings.deploy_url:
current_commit.create_status(
state="success",
description="No Docs Changes",
context="deploy-docs",
target_url=run_url,
)
logging.info("No docs changes found")
return
if not settings.deploy_url:
current_commit.create_status(
state="pending",
description="Deploy Docs",
description="Deploying Docs",
context="deploy-docs",
target_url=run_url,
)
@ -41,7 +51,7 @@ def main():
return
current_commit.create_status(
state="success",
description="Deploy Docs",
description="Docs Deployed",
context="deploy-docs",
target_url=run_url,
)

Loading…
Cancel
Save