From e6c12634e94d2576a828337fc9b55b8da6319f8b Mon Sep 17 00:00:00 2001 From: Jiralite <33201955+Jiralite@users.noreply.github.com> Date: Thu, 24 Jul 2025 12:58:31 +0100 Subject: [PATCH] ci: disallow changes to these directories (#829) --- .github/workflows/check-deno.yml | 33 ----------------- .github/workflows/validate-pull-request.yml | 41 +++++++++++++++++++++ 2 files changed, 41 insertions(+), 33 deletions(-) delete mode 100644 .github/workflows/check-deno.yml create mode 100644 .github/workflows/validate-pull-request.yml diff --git a/.github/workflows/check-deno.yml b/.github/workflows/check-deno.yml deleted file mode 100644 index cef03e96..00000000 --- a/.github/workflows/check-deno.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Deno - -on: - pull_request: - types: - - opened - - synchronize - -jobs: - check_deno: - name: Ensure Deno types are in sync with the code - runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write - - steps: - - name: Checkout Project - uses: actions/checkout@v4 - - - name: Use Node.js - uses: actions/setup-node@v4 - with: - cache: 'yarn' - node-version-file: package.json - - - name: Install Dependencies - run: yarn - - - name: Run Check Script - run: node ./scripts/actions/report-deno-not-ran.mjs - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/validate-pull-request.yml b/.github/workflows/validate-pull-request.yml new file mode 100644 index 00000000..fec1fb79 --- /dev/null +++ b/.github/workflows/validate-pull-request.yml @@ -0,0 +1,41 @@ +name: Validate Pull Request +on: + pull_request: +jobs: + deno: + name: Ensure Deno types are synchronized + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + - name: Checkout Project + uses: actions/checkout@v4 + + - name: Use Node.js + uses: actions/setup-node@v4 + with: + cache: 'yarn' + node-version-file: package.json + + - name: Install Dependencies + run: yarn + + - name: Run Check Script + run: node ./scripts/actions/report-deno-not-ran.mjs + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + validate-supported-versions: + runs-on: ubuntu-latest + name: Disallow unsupported API versions + steps: + - name: Check for unsupported API changes + env: + GH_TOKEN: ${{ github.token }} + run: | + PATTERNS="gateway/v6.ts|gateway/v8.ts|payloads/v6/|payloads/v8/|rest/v6/|rest/v8/|rpc/v8.ts|utils/v8.ts|voice/v8.ts|^v6.ts$|^v8.ts$" + + if gh pr view ${{ github.event.pull_request.number }} --repo ${{github.repository}} --json files --jq ".files[].path | select(test(\"$PATTERNS\"))" | grep -q .; then + echo "::error::Unsupported API versions modified. Please make changes to current API versions only." + exit 1 + fi