fix: small updates #72
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Pull Request | |
on: pull_request | |
permissions: | |
contents: write | |
pull-requests: write | |
checks: write | |
jobs: | |
review: | |
if: ${{ github.event.action != 'closed' }} | |
name: Chat GPT Code Peer Review | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: edelauna/gpt-review@v1 | |
with: | |
openai_api_key: ${{ secrets.OPENAI_API_KEY }} | |
ignore_files: package-lock.json | |
lint: | |
if: ${{ github.event.action != 'closed' }} | |
name: Lint | |
runs-on: ubuntu-latest | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
name: Setup Node | |
- run: corepack enable | |
- run: yarn install | |
- run: yarn lint:report | |
continue-on-error: true | |
- run: mkdir -p eslint_reports | |
- name: Collect Reports | |
uses: ralphschuler/[email protected] | |
with: | |
pattern: "**/eslint_report.json" | |
output_directory: "eslint_reports/" | |
- uses: ralphschuler/[email protected] | |
with: | |
input_directory: "eslint_reports/" | |
output_file: "eslint_report.json" | |
- uses: ataylorme/[email protected] | |
with: | |
report-json: "eslint_report.json" | |
- name: Upload ESLint report | |
uses: actions/upload-artifact@v3 | |
with: | |
name: eslint_report.json | |
path: eslint_report.json | |
retention-days: 5 | |
test: | |
name: Test | |
if: ${{ github.event.action != 'closed' }} | |
runs-on: ubuntu-latest | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
- run: corepack enable | |
- run: yarn | |
- run: yarn test | |
# - run: mkdir -p test_reports | |
# - name: Collect Reports | |
# uses: ./.github/actions/collect-files | |
# with: | |
# pattern: "**/test_report.json" | |
# target_directory: "test_reports/" | |
# - uses: ./.github/actions/merge-test-reports | |
# with: | |
# input_directory: "test_reports/" | |
# output_file: "test_report.json" | |
# - uses: ataylorme/test-annotate-action@v2 | |
# with: | |
# report-json: "test_report.json" | |
# format: | |
# if: ${{ github.event.pull_request.merged == true }} | |
# name: Format | |
# runs-on: ubuntu-latest | |
# env: | |
# NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# steps: | |
# - uses: actions/checkout@v4 | |
# - uses: actions/[email protected] | |
# with: | |
# node-version: 20 | |
# - run: corepack enable | |
# - run: yarn | |
# - run: yarn format:fix | |
# - run: | | |
# git config --global user.name '${{ github.pull_request.user.login }}' | |
# git config --global user.email '${{ github.pull_request.user.email }}' | |
# git add . | |
# git commit -m "chore: format code" | |
# git push | |
opencommit: | |
if: ${{ github.event.pull_request.merged == true }} | |
timeout-minutes: 10 | |
name: OpenCommit | |
runs-on: ubuntu-latest | |
permissions: write-all | |
steps: | |
- name: Setup Node.js Environment | |
uses: actions/setup-node@v4 | |
- run: corepack enable | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: di-sukharev/[email protected] | |
with: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
env: | |
# set openAI api key in repo actions secrets, | |
# for openAI keys go to: https://platform.openai.com/account/api-keys | |
# for repo secret go to: <your_repo_url>/settings/secrets/actions | |
OCO_OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
# customization | |
OCO_OPENAI_MAX_TOKENS: 500 | |
OCO_OPENAI_BASE_PATH: '' | |
OCO_DESCRIPTION: false | |
OCO_EMOJI: false | |
OCO_MODEL: gpt-3.5-turbo-16k | |
OCO_LANGUAGE: en | |
OCO_PROMPT_MODULE: conventional-commit |