From e1f0b0b3fc00f948d48b59860366bf33813ee00f Mon Sep 17 00:00:00 2001 From: Mayur Dayal Date: Wed, 24 Apr 2024 19:41:45 +0530 Subject: [PATCH 1/2] added style guide option --- action.yml | 4 ++++ src/index.py | 12 ++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/action.yml b/action.yml index 822e2d3..bd9ef5a 100644 --- a/action.yml +++ b/action.yml @@ -12,6 +12,9 @@ inputs: branch_name: description: 'Base Branch for the PR' required: true + style_guide: + description: "Style guide for the documentation" + required: true outputs: {} runs: @@ -45,6 +48,7 @@ runs: BRANCH_NAME: ${{ inputs.branch_name }} GITHUB_SHA: ${{ github.sha }} COMMIT_MSG: ${{ steps.prep.outputs.escaped_commit_msg }} + STYLE_GUIDE: ${{ inputs.style_guide }} run: | python -u run_doc_gen.py diff --git a/src/index.py b/src/index.py index b46b453..dd686d8 100644 --- a/src/index.py +++ b/src/index.py @@ -121,20 +121,20 @@ async def main(): print("Branch Name: ", os.getenv("BRANCH_NAME")) print("Commit SHA: ", os.getenv("GITHUB_SHA")) print("Commit Message: ", os.getenv("COMMIT_MSG")) + print("Style Guide: ", os.getenv("STYLE_GUIDE")) + headers = { "api-key": os.getenv("SNORKELL_API_KEY"), # Replace with your API key "Content-Type": "application/json", } + data = { - "installation_id": os.getenv( - "SNORKELL_CLIENT_ID" - ), # Replace with your client ID - "full_repo_name": os.getenv( - "GITHUB_REPOSITORY" - ), # Replace with your repository name + "installation_id": os.getenv("SNORKELL_CLIENT_ID"), # Replace with your client ID + "full_repo_name": os.getenv("GITHUB_REPOSITORY"), # Replace with your repository name "base_branch": os.getenv("BRANCH_NAME"), # Replace with your branch name "commit_sha": os.getenv("GITHUB_SHA"), # Replace with your commit SHA "commit_message": os.getenv("COMMIT_MSG"), # Replace with your commit message + "style_guide": os.getenv("STYLE_GUIDE"), # Replace with your style guide } try: From 6da58143db90d5bdf56d4b9fd933ceb5d379731c Mon Sep 17 00:00:00 2001 From: Mayur Dayal Date: Thu, 25 Apr 2024 18:39:20 +0530 Subject: [PATCH 2/2] reverted style guide to be optional input --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index bd9ef5a..e4ae254 100644 --- a/action.yml +++ b/action.yml @@ -14,7 +14,7 @@ inputs: required: true style_guide: description: "Style guide for the documentation" - required: true + required: false outputs: {} runs: