diff --git a/.github/workflows/run-on-label.yml b/.github/workflows/run-on-label.yml new file mode 100644 index 0000000..b6922ec --- /dev/null +++ b/.github/workflows/run-on-label.yml @@ -0,0 +1,38 @@ +name: Manual Tests on Label + +on: + pull_request_target: + types: [labeled] + +jobs: + test-on-label: + if: github.event.label.name == 'run-tests' + + runs-on: ubuntu-latest + + steps: + - name: Checkout PR code + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Install dependencies + run: npm install + + - name: Create Google credentials file + shell: bash + run: | + echo "$GOOGLE_APPLICATION_CREDENTIALS_JSON" > google-credentials.json + env: + GOOGLE_APPLICATION_CREDENTIALS_JSON: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS_JSON }} + + - name: Run Vitest tests + env: + GOOGLEAI_API_KEY: ${{ secrets.GOOGLEAI_API_KEY }} + GOOGLE_APPLICATION_CREDENTIALS: ./google-credentials.json + run: npm test \ No newline at end of file