Skip to content

Commit

Permalink
Final nail
Browse files Browse the repository at this point in the history
  • Loading branch information
rsb-23 committed Dec 1, 2024
1 parent aa1e37b commit 1312cc3
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 14 deletions.
1 change: 0 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ jobs:
fetch-depth: 0

- name: Run script
id: spelling
uses: ./
with:
token: ${{ secrets.PAT }}
Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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 }}
```
20 changes: 7 additions & 13 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
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
type: list
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"
Expand All @@ -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
Expand All @@ -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

0 comments on commit 1312cc3

Please sign in to comment.