Skip to content

fix(src): 优化代码以处理结尾的三个反引号 #30

fix(src): 优化代码以处理结尾的三个反引号

fix(src): 优化代码以处理结尾的三个反引号 #30

Workflow file for this run

name: CI
on:
push:
branches:
- main
paths:
- '**/*.ts'
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: main
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Get pnpm store directory
shell: bash
run: |
STORE_PATH=$(pnpm store path --silent)
echo "STORE_PATH=$STORE_PATH" >> $GITHUB_ENV
echo "pnpm store path: $STORE_PATH"
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: |
pnpm install --no-frozen-lockfile || (echo "Dependency installation failed" && exit 1)
- name: Check format
run: |
pnpm format:check || echo "Format check failed"
- name: Run lint
run: |
pnpm lint || echo "Linting issues detected"
- name: Build
run: |
pnpm build || (echo "Build failed" && exit 1)
- name: Test
run: |
pnpm test || (echo "Test failed" && exit 1)
mkdir -p translate
node ./dist/index.js -i ./src/system.md -o ./translate/system-gpt-4o-en.md -l English --openai-url https://models.inference.ai.azure.com/chat/completions --api-key ${{ secrets.OPENAI_API_KEY }} --model gpt-4o
node ./dist/index.js -i ./src/system.md -o ./translate/system-ministral-3b-ja.md -l Japanese --openai-url https://models.inference.ai.azure.com/chat/completions --api-key ${{ secrets.OPENAI_API_KEY }} --model Ministral-3B
node ./dist/index.js -i ./src/system.md -o ./translate/system-phi-3.5-mini-instruct-fr.md -l 法语 --openai-url https://models.inference.ai.azure.com/chat/completions --api-key ${{ secrets.OPENAI_API_KEY }} --model Phi-3.5-mini-instruct
- name: Commit and Push
run: |
git add README-zh.md translate/
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git config advice.ignoredHook false
git commit -m "docs(README): update README-zh.md"
git push origin main --force || echo "Push to repository failed"
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: dist
path: dist/
if: success()