From 1312cc3eeabe432191c647fd0949568972b4bce0 Mon Sep 17 00:00:00 2001 From: rsb-23 <57601627+rsb-23@users.noreply.github.com> Date: Mon, 2 Dec 2024 02:55:52 +0530 Subject: [PATCH] Final nail --- .github/workflows/test.yml | 1 - README.md | 16 ++++++++++++++++ action.yml | 20 +++++++------------- 3 files changed, 23 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0f9370a..8a2a083 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,6 @@ jobs: fetch-depth: 0 - name: Run script - id: spelling uses: ./ with: token: ${{ secrets.PAT }} diff --git a/README.md b/README.md index e69de29..ac362c9 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,16 @@ +# actions/check-typo + +This Github Action uses AI to find typos and grammatical errors in PR changes. + +## Usage +Refer [test.yml](./.github/workflows/test.yml) +```yaml + - name: Check typos in data files + uses: actions/check-diff-typo@v1 + with: + token: ${{ secrets.PAT }} + files: | + tests/file.txt + tests/file.json + GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }} +``` diff --git a/action.yml b/action.yml index 5cfea25..6fd5c6a 100644 --- a/action.yml +++ b/action.yml @@ -1,11 +1,15 @@ -name: 'Check-Diff-Typo' -description: 'Analyzes and comments on PR diff typos for specified files' +name: 'Check-Typo' +description: 'Checks diff of specified files for typos and suggests fixes on PR.' author: 'Rishabh B' branding: icon: 'git-pull-request' color: 'green' inputs: + token: + description: 'PAT with `pull_request:write` permission' + required: true + default: ${{ github.token }} files: description: 'Comma-separated list of files to analyze' required: true @@ -13,15 +17,7 @@ inputs: GROQ_API_KEY: description: 'Groq API Key' required: true - token: - description: 'PAT with pull_request:write permission' - required: true - default: ${{ github.token }} -outputs: - comment: - description: 'Generated comment markdown' - value: ${{ steps.spelling.outputs.comment }} runs: using: "composite" @@ -32,7 +28,6 @@ runs: cache: 'pip' - name: Setup python env run: | - pwd python -m venv .venv source .venv/bin/activate python -m pip install --upgrade pip @@ -47,12 +42,11 @@ runs: id: spelling shell: bash env: - PR_BASE: ${{ github.event.pull_request.base.ref }} + PR_BASE: ${{ github.base_ref }} INPUT_FILES: ${{ inputs.files }} GROQ_API_KEY: ${{ inputs.GROQ_API_KEY }} token: ${{ inputs.token }} PR_NO: ${{ github.event.pull_request.number }} run: | - pwd source .venv/bin/activate python main.py