Skip to content

Merge pull request #668 from lupu60/revert-pr-661 #55

Merge pull request #668 from lupu60/revert-pr-661

Merge pull request #668 from lupu60/revert-pr-661 #55

Workflow file for this run

name: PR Validation

Check failure on line 1 in .github/workflows/pr-validation.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/pr-validation.yml

Invalid workflow file

(Line: 55, Col: 19): Unexpected symbol: '='. Located at position 14 within expression: job.status === 'success' ? '✅ Passed' : '❌ Failed'
on:
pull_request:
branches: [ master ]
jobs:
validate:
name: Validate PR
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '22.x'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run lint
run: npm run lint
- name: Check formatting
run: npx prettier --check "packages/**/*.{ts,json}"
- name: Type check
run: |
set -e
for dir in packages/*/; do
if [ -f "$dir/tsconfig.build.json" ]; then
cd "$dir"
npx tsc --noEmit -p tsconfig.build.json || exit 1
cd ../..
fi
done
- name: Build
run: npm run build
- name: Run tests
run: npm test
env:
CI: true
- name: Comment PR
uses: actions/github-script@v7
if: always()
with:
script: |
const status = '${{ job.status }}' === 'success' ? '✅' : '❌';
const body = `## PR Validation Results ${status}
- **Lint**: ${{ job.status === 'success' ? '✅ Passed' : '❌ Failed' }}
- **Format**: ${{ job.status === 'success' ? '✅ Passed' : '❌ Failed' }}
- **Type Check**: ${{ job.status === 'success' ? '✅ Passed' : '❌ Failed' }}
- **Build**: ${{ job.status === 'success' ? '✅ Passed' : '❌ Failed' }}
- **Tests**: ${{ job.status === 'success' ? '✅ Passed' : '❌ Failed' }}
[View workflow run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: body
});