From 0533e2087ab5e77d38a0db7441c667434060955b Mon Sep 17 00:00:00 2001 From: "Hauzer S. Lee" Date: Mon, 14 Oct 2024 19:38:56 +0800 Subject: [PATCH] chore: add .github/workflows --- .github/workflows/pr-size-label.yml | 27 ++++++++++++++ .github/workflows/pr-title-semantic-check.yml | 36 +++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 .github/workflows/pr-size-label.yml create mode 100644 .github/workflows/pr-title-semantic-check.yml diff --git a/.github/workflows/pr-size-label.yml b/.github/workflows/pr-size-label.yml new file mode 100644 index 0000000..599467e --- /dev/null +++ b/.github/workflows/pr-size-label.yml @@ -0,0 +1,27 @@ +name: size-label + +on: pull_request_target + +jobs: + size-label: + permissions: + contents: read + pull-requests: write + runs-on: ubuntu-latest + steps: + - name: size-label + uses: "pascalgn/size-label-action@v0.5.0" + continue-on-error: true + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + IGNORED: "openapi/**\npackages/request/src/_client/nodeApi.ts\npackages/request/src/_client.ts\npackages/request/src/_recommendation-client.ts\nservices/node-api/src/drizzle/schema.ts\npackages/schema/src/db/**\nclients/studio/public/locales/**\nclients/web/public/locales/**" + with: + sizes: > + { + "0": "XS", + "50": "S", + "150": "M", + "500": "L", + "2000": "XL", + "5000": "XXL" + } diff --git a/.github/workflows/pr-title-semantic-check.yml b/.github/workflows/pr-title-semantic-check.yml new file mode 100644 index 0000000..0756389 --- /dev/null +++ b/.github/workflows/pr-title-semantic-check.yml @@ -0,0 +1,36 @@ +name: PR Title Semantic Check + +on: + pull_request: + types: + - opened + - edited + - synchronize + +permissions: + pull-requests: read + +jobs: + main: + name: Validate PR title + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + # Configure which types are allowed (newline-delimited). + # Default: https://github.com/commitizen/conventional-commit-types + types: | + feat + chore + docs + style + refactor + perf + test + fix + release + ignoreLabels: | + bot + ignore-semantic-pull-request