Skip to content

Updated OpenAiEndpoint.ts #35

Updated OpenAiEndpoint.ts

Updated OpenAiEndpoint.ts #35

name: Prettier JS
on:
push:
branches: [ ts ]
paths:
- JS/**
- .github/workflows/prettier-js-format.yml
pull_request:
paths:
- JS/**
- ".github/workflows/linter.yml"
permissions:
contents: write
jobs:
formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4 # v2 minimum required
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install Prettier
run: npm install prettier
- name: Install ESLint
run: >
npm install eslint@latest &&
npm install @microsoft/eslint-formatter-sarif@latest eslint-config-google@latest eslint-plugin-import@latest @typescript-eslint/eslint-plugin@latest @typescript-eslint/parser@latest eslint-config-prettier@latest eslint-plugin-prettier@latest
- name: Get cache date
id: get-date
run: echo "::set-output name=date::$(/bin/date -u "+%Y%m%d")"
shell: bash
- name: ESLint Cache
uses: actions/cache@v3
with:
path: ./.eslintcache
key: ${{ runner.os }}-eslintcache-${{ hashFiles('./eslintcache') }}
restore-keys: |
${{ runner.os }}-eslintcache-
- name: Run ESLint
run: npx eslint JS
--fix
--cache
--config JS/.eslintrc.js
--ext .js,.jsx,.ts,.tsx
continue-on-error: true
# - name: Upload analysis results to GitHub
# uses: github/codeql-action/upload-sarif@v2
# with:
# sarif_file: eslint-results.sarif
# wait-for-processing: true
- name: Run Prettiers
run: npx prettier --tab-width 4 --print-width 100 --trailing-comma es5 --ignore-path "$(CURDIR)/node_modules/*" --write JS/
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Automatically applying Prettier changes
commit_user_name: GitHub Actions
commit_user_email: [email protected]
commit_author: GitHub Actions <[email protected]>
branch: ${{ github.head_ref }}
# - name: Run JSON Prettier
# run: npx prettier --write "ts/**/*.json" --no-error-on-unmatched-pattern
# - name: Commit JSON Prettier cchanges
# uses: stefanzweifel/git-auto-commit-action@v4
# with:
# commit_message: Format json via prettier
# commit_user_name: GitHub Actions
# commit_user_email: [email protected]
# commit_author: GitHub Actions <[email protected]>
# branch: ${{ github.head_ref }}