File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -64,10 +64,10 @@ jobs:
64
64
gitHubToken : ${{ secrets.GITHUB_TOKEN }}
65
65
branch : ${{ ( github.event.workflow_run.head_repository.full_name == github.repository && github.event.workflow_run.head_branch == 'main' && 'main' ) || ( github.event.workflow_run.head_sha ) }}
66
66
- name : Comment Deploy
67
- if : steps.deploy.outputs.url != ''
68
67
run : python ./scripts/deploy_docs_status.py
69
68
env :
70
69
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
71
70
DEPLOY_URL : ${{ steps.deploy.outputs.url }}
72
71
COMMIT_SHA : ${{ github.event.workflow_run.head_sha }}
73
72
RUN_ID : ${{ github.run_id }}
73
+ IS_DONE : " true"
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ class Settings(BaseSettings):
12
12
deploy_url : str | None = None
13
13
commit_sha : str
14
14
run_id : int
15
+ is_done : bool = False
15
16
16
17
17
18
def main ():
@@ -30,18 +31,27 @@ def main():
30
31
commits = list (use_pr .get_commits ())
31
32
current_commit = [c for c in commits if c .sha == settings .commit_sha ][0 ]
32
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
+ return
33
43
if not settings .deploy_url :
34
44
current_commit .create_status (
35
45
state = "pending" ,
36
- description = "Deploy Docs" ,
46
+ description = "Deploying Docs" ,
37
47
context = "deploy-docs" ,
38
48
target_url = run_url ,
39
49
)
40
50
logging .info ("No deploy URL available yet" )
41
51
return
42
52
current_commit .create_status (
43
53
state = "success" ,
44
- description = "Deploy Docs" ,
54
+ description = "Docs Deployed " ,
45
55
context = "deploy-docs" ,
46
56
target_url = run_url ,
47
57
)
You can’t perform that action at this time.
0 commit comments