Skip to content
This repository was archived by the owner on Feb 12, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 43 additions & 5 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'

# Include all changes, not just PRs
# Configuration for PR-based workflow
include-pre-releases: false
commitish: master

Expand All @@ -10,24 +10,28 @@ categories:
labels:
- 'feature'
- 'enhancement'
collapse-after: 3
- title: '🐛 Bug Fixes'
labels:
- 'bug'
- 'fix'
collapse-after: 3
- title: '📚 Documentation'
labels:
- 'documentation'
- 'docs'
collapse-after: 3
- title: '🧹 Maintenance'
labels:
- 'maintenance'
- 'chore'
- 'dependencies'
collapse-after: 3
- title: '⚠️ Breaking Changes'
labels:
- 'breaking-change'

change-template: '- $TITLE @$AUTHOR'
change-template: '- $TITLE (#$NUMBER) @$AUTHOR'
no-changes-template: '- No changes'
change-title-escapes: '\<*_&'

Expand Down Expand Up @@ -68,31 +72,65 @@ exclude-labels:
- 'invalid'
- 'wontfix'

# Enhanced autolabeler for conventional commits
# Enhanced autolabeler for conventional commits and files
autolabeler:
- label: 'feature'
title:
- '/^feat(\(.+\))?\!?:/i'
- '/^Feature:/i'
branch:
- '/^feature\/.+/'
- '/^feat\/.+/'
- label: 'bug'
title:
- '/^fix(\(.+\))?\!?:/i'
- '/^Fix:/i'
- '/^Bug:/i'
branch:
- '/^fix\/.+/'
- '/^bug\/.+/'
- '/^hotfix\/.+/'
- label: 'documentation'
title:
- '/^docs(\(.+\))?\!?:/i'
- '/^Documentation:/i'
files:
- '*.md'
- 'docs/**'
- 'docs/**/*'
- '.github/**/*'
branch:
- '/^docs\/.+/'
- label: 'chore'
title:
- '/^chore(\(.+\))?\!?:/i'
- '/^ci(\(.+\))?\!?:/i'
- '/^build(\(.+\))?\!?:/i'
- '/^refactor(\(.+\))?\!?:/i'
- '/^Chore:/i'
files:
- 'package.json'
- 'package-lock.json'
- '.github/workflows/**/*'
- '.gitignore'
- 'tsconfig.json'
- 'biome.json'
branch:
- '/^chore\/.+/'
- '/^refactor\/.+/'
- label: 'dependencies'
title:
- '/^(chore|build)(\(.+\))?\!?:\s*(bump|update|upgrade)/i'
files:
- 'package.json'
- 'package-lock.json'
- label: 'breaking-change'
title:
- '/^.*\!:/i'
- '/^BREAKING CHANGE:/i'

# Replacers to clean up commit messages
# Replacers to clean up commit messages in release notes
replacers:
- search: '/^(feat|fix|docs|chore|ci|build|refactor)(\(.+\))?\!?:\s*/i'
replace: ''
- search: '/^(Feature|Fix|Bug|Documentation|Chore):\s*/i'
replace: ''
110 changes: 110 additions & 0 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
name: PR Checks

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
# Lint and validate PR title
pr_validation:
name: PR Validation
runs-on: ubuntu-latest
steps:
- name: Validate PR title
uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# Configure which types are allowed (newline-delimited).
types: |
feat
fix
docs
style
refactor
perf
test
build
ci
chore
revert
# Configure which scopes are allowed (newline-delimited).
# These are optional and can be omitted.
scopes: |
cli
commands
docs
ci
deps
# Configure that a scope is required.
requireScope: false
# Configure additional validation for the subject based on a regex.
# This example ensures the subject doesn't start with an uppercase character.
subjectPattern: ^(?![A-Z]).+$
# If you use GitHub Enterprise, you can set this to the URL of your server
# githubBaseUrl: https://github.myorg.com/api/v3
# Configure additional validation for the subject based on a regex.
subjectPatternError: |
The subject "{subject}" found in the pull request title "{title}"
didn't match the configured pattern. Please ensure that the subject
doesn't start with an uppercase character.

# Check for required files and structure
project_structure:
name: Project Structure Check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Check required files
run: |
echo "Checking for required files..."

required_files=(
"package.json"
"readme.md"
"CHANGELOG.md"
"LICENSE"
"CONTRIBUTING.md"
".github/workflows/release.yml"
".github/release-drafter.yml"
)

missing_files=()

for file in "${required_files[@]}"; do
if [[ ! -f "$file" ]]; then
missing_files+=("$file")
fi
done

if [[ ${#missing_files[@]} -gt 0 ]]; then
echo "❌ Missing required files:"
printf '%s\n' "${missing_files[@]}"
exit 1
else
echo "✅ All required files are present"
fi

# Add a label based on PR size
pr_size_labeler:
name: PR Size Labeler
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Label PR based on size
uses: codelytv/pr-size-labeler@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
xs_label: 'size/XS'
xs_max_size: '10'
s_label: 'size/S'
s_max_size: '100'
m_label: 'size/M'
m_max_size: '500'
l_label: 'size/L'
l_max_size: '1000'
xl_label: 'size/XL'
fail_if_xl: 'false'
45 changes: 8 additions & 37 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
name: Release & Publish

on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- master
release:
types: [published]

jobs:
# Build and test the project
# Build and test the project for all PRs and pushes
build:
name: Build & Test
runs-on: ubuntu-latest
Expand Down Expand Up @@ -36,49 +38,18 @@ jobs:
with:
name: dist
path: dist/
# Create release draft using release-drafter
create_release_draft:
name: Create Release Draft

# Update release draft when changes are pushed to master
update_release_draft:
name: Update Release Draft
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
pull-requests: read
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Check if release is needed
id: check_commits
run: |
# Get last tag
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
echo "Last tag: $LAST_TAG"

# Get commits since last tag
if [ -z "$LAST_TAG" ]; then
COMMITS=$(git log --oneline --pretty=format:"%s")
else
COMMITS=$(git log ${LAST_TAG}..HEAD --oneline --pretty=format:"%s")
fi

echo "Commits since last tag:"
echo "$COMMITS"

# Check if there are any commits that warrant a release
SHOULD_RELEASE=false
if echo "$COMMITS" | grep -qE "^(feat|fix|perf|revert|docs|style|refactor|test|build|ci|chore|BREAKING CHANGE)"; then
SHOULD_RELEASE=true
fi

echo "Should release: $SHOULD_RELEASE"
echo "should_release=$SHOULD_RELEASE" >> $GITHUB_OUTPUT

- name: Run Release Drafter
if: steps.check_commits.outputs.should_release == 'true'
uses: release-drafter/release-drafter@v5
with:
config-name: release-drafter.yml
Expand Down
Loading