WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Code Quality Updates #53

Code Quality Updates

Code Quality Updates #53

Workflow file for this run

name: PR Validation
on:
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
validate:
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version-file: .nvmrc
cache: "npm"
- name: Install dependencies
run: npm install
- name: Run format check
run: npm run format:check
- name: Run lint check
run: npm run lint:check
- name: Type check
run: npm run type-check
- name: Post testing checklist
if: success()
env:
GH_TOKEN: ${{ github.token }}
run: |
# Find and delete existing comment(s)
COMMENT_IDS=$(gh pr view ${{ github.event.pull_request.number }} --json comments --jq -r '.comments[] | select(.body | contains("<!-- pr-validation-checklist -->")) | .id')
if [ -n "$COMMENT_IDS" ]; then
echo "Found existing comments to delete: $COMMENT_IDS"
for COMMENT_ID in $COMMENT_IDS; do
echo "Deleting comment: $COMMENT_ID"
gh api --method DELETE "/repos/${{ github.repository }}/issues/comments/$COMMENT_ID" || echo "Failed to delete comment $COMMENT_ID"
done
fi
# Create new comment
gh pr comment ${{ github.event.pull_request.number }} --body-file - <<'EOF'
<!-- pr-validation-checklist -->
## ✅ Build Successful!
Please test the following before merging:
- [ ] Main page
- [ ] About page
- [ ] Dark/Light mode toggle
- [ ] Search functionality
- [ ] Individual blog post
- [ ] RSS feed
_Last updated: $(date -u +'%Y-%m-%d %H:%M:%S UTC')_
EOF