Skip to content
Myr

👷 Update docs-previews to handle no docs changes (#912)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Sebastián Ramírez · committed by GitHub · parent 311fbaa · Browse files · 2 files+13 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+13 added−3 removed

  • other:+13 added−3 removed

2 files+13 added−3 removed

modified:.github/workflows/deploy-docs.yml+1 added-1 removed
modified:scripts/deploy_docs_status.py+12 added-2 removed
10 unmodified lines
11 github_token: SecretStr12 deploy_url: str | None = None13 commit_sha: str14 run_id: int15 is_done: bool = False161718def main():19 logging.basicConfig(level=logging.INFO)
10 unmodified lines
30 return31 commits = list(use_pr.get_commits())32 current_commit = [c for c in commits if c.sha == settings.commit_sha][0]33 run_url = f"https://github.com/{settings.github_repository}/actions/runs/{settings.run_id}"34 if settings.is_done and not settings.deploy_url:35 current_commit.create_status(36 state="success",37 description="No Docs Changes",38 context="deploy-docs",39 target_url=run_url,40 )41 logging.info("No docs changes found")42 return43 if not settings.deploy_url:44 current_commit.create_status(45 state="pending",36 description="Deploy Docs",46 description="Deploying Docs",47 context="deploy-docs",48 target_url=run_url,49 )50 logging.info("No deploy URL available yet")51 return52 current_commit.create_status(53 state="success",44 description="Deploy Docs",54 description="Docs Deployed",55 context="deploy-docs",56 target_url=run_url,57 )58
31 unmodified lines