Skip to content

Commit

Permalink
Suggester workflow (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
rob-luke authored Apr 29, 2023
1 parent 460438c commit 0c00bed
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 1 deletion.
38 changes: 38 additions & 0 deletions .github/workflows/suggester-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: suggester

on:
pull_request:
branches: [main]


jobs:
docker:
name: execute
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: pwd
run: |
pwd
- name: ls
run: |
ls
- name: Docstring Auditor
uses: agencyenterprise/docstring-auditor@main
with:
openaiApiKey: ${{ secrets.OPENAI_API_KEY }}
path: .
code-block-name: docstring_auditor
ignore-dirs: tests
auto-fix: true

- name: suggester
uses: reviewdog/action-suggester@v1
with:
tool_name: docstring-auditor
10 changes: 9 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,15 @@ runs:
run: pip install --upgrade hatch

- name: Execute
if: ${{ inputs.auto-fix }}
shell: bash
run: hatch run docstring-auditor --model ${{ inputs.model }} --code-block-name ${{ inputs.code-block-name }} --ignore-dirs ${{ inputs.ignore-dirs }} --auto-fix ${{ inputs.auto-fix }} ${{ inputs.path }}
run: hatch run docstring-auditor --model ${{ inputs.model }} --code-block-name ${{ inputs.code-block-name }} --ignore-dirs ${{ inputs.ignore-dirs }} --auto-fix ${{ inputs.path }}
env:
OPENAI_API_KEY: ${{ inputs.openaiApiKey }}

- name: Execute
if: ${{ inputs.auto-fix == false}}
shell: bash
run: hatch run docstring-auditor --model ${{ inputs.model }} --code-block-name ${{ inputs.code-block-name }} --ignore-dirs ${{ inputs.ignore-dirs }} ${{ inputs.path }}
env:
OPENAI_API_KEY: ${{ inputs.openaiApiKey }}

0 comments on commit 0c00bed

Please sign in to comment.