10
10
11
11
12
12
repo_name = "widgetti/ipyreact"
13
- pr_number = int ( sys .argv [1 ]) # e.g 65
14
- run_id = sys .argv [2 ] # e.g 1324, usually obtained via ${{ github.run_id }} in GitHub Actions workflow files
13
+ commit_sha = sys .argv [1 ] # e.g d39677a321bca34df41ecc87ff7e539b450207f2
14
+ run_id = sys .argv [2 ] # e.g 1324, usually obtained via ${{ github.run_id }} or ${{ github.event.workflow_run.id }} in GitHub Actions workflow files
15
15
type = "solara" # streamlit/dash/vizro/solara/panel
16
16
17
17
# your default code
@@ -40,13 +40,10 @@ class ConfettiWidget(ipyreact.ValueWidget):
40
40
41
41
# GitHub Python API
42
42
repo = g .get_repo (repo_name )
43
- pr = repo .get_pull (pr_number )
44
43
45
44
base_url = f"https://py.cafe/snippet/{ type } /v1"
46
45
url = f"{ base_url } #code={ quote (code )} &requirements={ quote (requirements )} "
47
46
48
- commit_sha = pr .head .sha
49
-
50
47
# Define the deployment status
51
48
state = "success" # Options: 'error', 'failure', 'pending', 'success'
52
49
description = "Test out this PR on a PyCafe environment"
@@ -55,4 +52,4 @@ class ConfettiWidget(ipyreact.ValueWidget):
55
52
# Create the status on the commit
56
53
commit = repo .get_commit (commit_sha )
57
54
commit .create_status (state = "success" , target_url = url , description = "Test this PR in PyCafe environment" , context = "PyCafe" )
58
- print (f"Deployment status added to commit { commit_sha } , PR https://github.com/ { repo_name } /pull/ { pr_number } " )
55
+ print (f"Deployment status added to commit { commit_sha } " )
0 commit comments