Skip to content

Commit

Permalink
comment test - 2
Browse files Browse the repository at this point in the history
  • Loading branch information
tushar5526 committed Dec 30, 2023
1 parent 277ce59 commit 76d9169
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions action/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@
def comment_on_gh_pr(comment):
GITHUB_API_URL = os.environ.get("GITHUB_API_URL")
GITHUB_TOKEN = os.environ.get('INPUT_GITHUB_TOKEN')

if not GITHUB_TOKEN:
raise Exception("INVALID GITHUB TOKEN _ EMPTY")
pr_number = os.environ.get("GITHUB_REF_NAME").split('/')[0]

url = f"{GITHUB_API_URL}/repos/{os.environ.get('GITHUB_REPOSITORY')}/issues/{pr_number}/comments"

headers = {
"Authorization": f"Bearer {GITHUB_TOKEN}",
"Accept": "application/vnd.github.v3+json",
"X-GitHub-Api-Version": "2022-11-28",
"Accept": "application/vnd.github+json"
}

data = {"body": comment}
Expand Down

0 comments on commit 76d9169

Please sign in to comment.