Content/some variadic inspired briefs #6
Workflow file for this run
This file contains hidden or 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: PR Validation | |
| on: | |
| pull_request: | |
| branches: [main] | |
| types: [opened, synchronize, reopened] | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| jobs: | |
| validate: | |
| name: Validate PR | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: 'npm' | |
| - name: Install Dependencies | |
| run: npm ci | |
| - name: Run Linting | |
| run: npm run lint | |
| continue-on-error: false | |
| - name: Type Check and Build | |
| run: npm run build | |
| continue-on-error: false | |
| - name: Check Build Output | |
| run: | | |
| if [ ! -d "dist" ]; then | |
| echo "Error: Build output directory 'dist' not found" | |
| exit 1 | |
| fi | |
| echo "Build successful - dist directory created" | |
| echo "Files generated: $(find dist -type f | wc -l)" | |
| - name: Validate Internal Links | |
| run: npm run validate:links | |
| continue-on-error: false | |
| - name: Report Status | |
| if: always() | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const status = '${{ job.status }}'; | |
| const icon = status === 'success' ? '✅' : '❌'; | |
| const message = status === 'success' | |
| ? 'All checks passed! Ready for review.' | |
| : 'Some checks failed. Please review the errors above.'; | |
| github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: `## PR Validation ${icon}\n\n${message}\n\n### Checks Performed:\n- ✓ Linting\n- ✓ Type checking\n- ✓ Build verification\n- ✓ Internal link validation` | |
| }); |