refactor: add improvements to the genai routes with zod validation #14
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Code Quality Validation' | |
on: | |
push: | |
branches: | |
- 'feature/**' | |
- 'refactor/**' | |
jobs: | |
code_quality: | |
timeout-minutes: 30 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get Repository | |
uses: actions/checkout@v4 | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 9.5.0 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: pnpm | |
- name: Get dependencies | |
run: pnpm install | |
open_pr: | |
timeout-minutes: 5 | |
runs-on: ubuntu-latest | |
needs: [code_quality] | |
env: | |
GITHUB_TOKEN: ${{ secrets.CI_TOKEN }} | |
CURRENT_BRANCH_NAME: ${{ github.ref_name }} | |
steps: | |
- name: Get repository | |
uses: actions/checkout@v3 | |
- name: Check if PR already exists | |
id: pr-exists | |
run: | | |
prList=$(gh pr list \ | |
--repo "$GITHUB_REPOSITORY" \ | |
--json baseRefName,headRefName \ | |
--jq ' | |
map(select(.baseRefName == "main" and .headRefName == "${{ env.CURRENT_BRANCH_NAME }}")) | |
| length' | |
) | |
if ((prList > 0)); then | |
echo "skip=true" >> "$GITHUB_OUTPUT" | |
fi | |
- name: Create Pull Request | |
if: ${{ !steps.pr-exists.outputs.skip }} | |
run: | | |
gh pr create --base main \ | |
--title "[AUTOMATED-PR] - main <- ${{ env.CURRENT_BRANCH_NAME }}" \ | |
--body-file ".github/PULL_REQUEST_TEMPLATE.md" |