Skip to content

Change PR validation trigger to workflow_run #136

Change PR validation trigger to workflow_run

Change PR validation trigger to workflow_run #136

Workflow file for this run

name: Setup Bun
on:
workflow_dispatch:
pull_request:
branches:
- main
- develop
types: [opened, edited, reopened, synchronize]
permissions:
contents: write
jobs:
format:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
- name: Setup Bun
uses: oven-sh/setup-bun@v2.0.2
- name: Install dependencies
run: bun install
- name: Run formatter
run: bun run format
- name: Commit changes
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref != 'develop' }}
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Apply formatting changes
file_pattern: 'src/**'
branch: ${{ github.event.pull_request.head.ref }}
pr-check:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2.0.2
- name: Install dependencies
run: bun install
- name: Set environment variables
run: |
echo "SUPABASE_URL=${{ secrets.SUPABASE_URL }}" >> $GITHUB_ENV
echo "SUPABASE_ANON_KEY=${{ secrets.SUPABASE_ANON_KEY }}" >> $GITHUB_ENV
- name: Run build
run: bun run build