christiangoeschel d6b2a3e6d9
All checks were successful
Pull Request Checks / commit-message-check (pull_request) Successful in 6s
Pull Request Checks / linting (pull_request) Successful in 1m58s
feat: Add a CI pipeline and fix all code style issues
2025-02-27 00:08:41 -05:00

51 lines
1.4 KiB
YAML

name: Pull Request Checks
run-name: ${{ gitea.actor }} is building ${{ gitea.repository }} 🚀
on:
pull_request:
branches: [main]
jobs:
commit-message-check:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Verify if commits are squashed
run: |
commit_count=$(wc -l <(git log --pretty=%s HEAD ^origin/main) | awk -F' ' '{print $1}')
echo "[INFO] Number of commits for this PR: ${commit_count}"
if (( ${commit_count} != 1 )); then
echo "[ERROR] The commits are not squashed. Please run 'git rebase -i HEAD~${commit_count}' on your local repository."
echo "Then squash the most recent commits, keep the first one and finally 'git push -f'."
exit 1
else
echo "[INFO] Commits are squashed, good!"
fi
- name: Check commit message format
uses: ./.gitea/actions/commit-msg-check
linting:
runs-on: ubuntu-latest
needs: [commit-message-check]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Lint static source files
uses: ./.gitea/actions/pre-commit-linter
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'
- run: npm ci
- name: Run ESLint
run: |
npm run lint