From 4fc8836fc7cd5330fe8f0baf7362db4dc3f22b0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E7=86=B1?= Date: Wed, 17 Jan 2024 21:25:19 +0800 Subject: [PATCH] ci: support auto translation of issues (#1172) --- .github/workflows/check-pr.yml | 22 ++++++++++++ .github/workflows/issue-translator.yml | 12 +++++++ .github/workflows/playwright.yml | 5 ++- .github/workflows/pr-title-lint.yml | 48 -------------------------- 4 files changed, 38 insertions(+), 49 deletions(-) create mode 100644 .github/workflows/check-pr.yml create mode 100644 .github/workflows/issue-translator.yml delete mode 100644 .github/workflows/pr-title-lint.yml diff --git a/.github/workflows/check-pr.yml b/.github/workflows/check-pr.yml new file mode 100644 index 0000000000..b7e61d1bb7 --- /dev/null +++ b/.github/workflows/check-pr.yml @@ -0,0 +1,22 @@ +name: 📌 Check PR + +on: + pull_request: + types: + - opened + - edited + - synchronize + +permissions: + pull-requests: read + +jobs: + validate: + name: Validate PR title + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + subjectPattern: ^(?![A-Z]).+$ diff --git a/.github/workflows/issue-translator.yml b/.github/workflows/issue-translator.yml new file mode 100644 index 0000000000..b81e7c90dc --- /dev/null +++ b/.github/workflows/issue-translator.yml @@ -0,0 +1,12 @@ +name: 🌍 Issues Translator +on: + issue_comment: + types: [created] + issues: + types: [opened] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: usthe/issues-translate-action@v2.7 diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 35a445e8db..b974a84086 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -1,13 +1,16 @@ -name: Playwright Tests +name: 🎭 Playwright Tests + on: push: branches: [main, master] pull_request: branches: [main, master] + jobs: test: timeout-minutes: 60 runs-on: ubuntu-latest + steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/pr-title-lint.yml b/.github/workflows/pr-title-lint.yml deleted file mode 100644 index 73f56e2977..0000000000 --- a/.github/workflows/pr-title-lint.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: 📌 PR Title Lint - -on: - pull_request: - types: - - opened - - edited - - synchronize - -permissions: - contents: read - -jobs: - check-pull-request-title: - name: Check pull request title - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Install Node.js - uses: actions/setup-node@v3 - with: - node-version: 18 - - - name: Install pnpm - uses: pnpm/action-setup@v2 - with: - version: 8 - run_install: false - - - name: Get pnpm store directory - shell: bash - run: | - echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - - - 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 - - - run: echo "${{ github.event.pull_request.title }}" | pnpx commitlint -g ./commitlint.config.cjs