Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 17, 2024
1 parent 0f7693e commit c4c059f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
1 change: 0 additions & 1 deletion .github/workflows/pycafe-dashboards-in-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ jobs:
run: |
python tools/pycafe/create_py_cafe_url.py
- name: Run Github Tool
run: |
python tools/pycafe/test.py $GH_TOKEN ${{ env.COMMIT_HASH }} ${{ env.RUN_ID }}
Expand Down
16 changes: 8 additions & 8 deletions tools/pycafe/test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import sys
from github import Github
from urllib.parse import quote
import os

from github import Github

# Authenticate with GitHub
access_token = sys.argv[1]
Expand All @@ -21,19 +21,19 @@
pr_number = int(pr)
pr = repo.get_pull(pr_number)

base_url = f'https://py.cafe/snippet/{type}/v1'
url = f'{base_url}#code={quote(code)}&requirements={quote(requirements)}'
base_url = f"https://py.cafe/snippet/{type}/v1"
url = f"{base_url}#code={quote(code)}&requirements={quote(requirements)}"

# # Get the latest commit SHA from the PR
if 1:
commit_sha = pr.head.sha

# Define the deployment status
state = 'success' # Options: 'error', 'failure', 'pending', 'success'
description = 'Test out this PR on a PyCafe environment'
context = 'PyCafe'
state = "success" # Options: 'error', 'failure', 'pending', 'success'
description = "Test out this PR on a PyCafe environment"
context = "PyCafe"

# Create the status on the commit
commit = repo.get_commit(commit_sha)
commit.create_status(state=state, target_url=url, description=description, context=context)
print(f'Deployment status added to commit {commit_sha}')
print(f"Deployment status added to commit {commit_sha}")

0 comments on commit c4c059f

Please sign in to comment.