Skip to content

feat: add canonical link setup #1372

feat: add canonical link setup

feat: add canonical link setup #1372

Workflow file for this run

name: 🎀 Code Format (Verification)
on:
push:
branches:
- main
- develop
pull_request:
jobs:
code-format:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref || github.ref }}
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: npm ci
- name: Code format check
id: fmt_check
continue-on-error: true
run: |
if ! npm run fmt:check; then
echo "exit_code=1" >> "$GITHUB_OUTPUT"
fi
- name: Auto-format (Markdown files)
if: steps.fmt_check.outputs.exit_code != '0' && github.event_name == 'pull_request'
run: npx prettier --write "src/**/*.{md,mdx}"
- name: Commit formatted (Markdown files)
if: steps.fmt_check.outputs.exit_code != '0' && github.event_name == 'pull_request'
run: |
git config --global user.name 'GitHub Action'
git config --global user.email '[email protected]'
if [[ -n "$(git status --porcelain)" ]]; then
git add .
if git commit -m "chore: 🤖 code format" --no-verify; then
git push
else
echo "🦖 Skipped! No changes to commit..."
fi
else
echo "🦖 Skipped! No changes found."
fi