diff --git a/.github/actions/validate-pr-title/action.yml b/.github/actions/validate-pr-title/action.yml new file mode 100644 index 00000000..9eafe9aa --- /dev/null +++ b/.github/actions/validate-pr-title/action.yml @@ -0,0 +1,41 @@ +name: 'Validate PR Title' +description: 'Validates that PR titles follow conventional commit format with custom types' +inputs: + title: + description: 'PR title to validate' + required: true +outputs: + valid: + description: 'Whether the title is valid' + value: ${{ steps.validate.outputs.valid }} +runs: + using: 'composite' + steps: + - name: Validate PR title + id: validate + shell: bash + run: | + title="${{ inputs.title }}" + + # Define allowed types + allowed_types="feat|fix|docs|style|refactor|perf|test|build|ci|chore|deps" + + # Check if title matches conventional commit format + if echo "$title" | grep -qE "^($allowed_types)(\(.+\))?!?: .+"; then + echo "valid=true" >> $GITHUB_OUTPUT + echo "✅ PR title is valid: $title" + else + echo "valid=false" >> $GITHUB_OUTPUT + echo "❌ PR title is invalid: $title" + echo "" + echo "Expected format: [optional scope]: " + echo "" + echo "Allowed types: $allowed_types" + echo "" + echo "Examples:" + echo " feat: add new feature" + echo " fix: resolve bug" + echo " deps: update dependencies" + echo " chore: update CI configuration" + exit 1 + fi diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 2e5f32d5..1227adb8 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -10,7 +10,7 @@ updates: schedule: interval: "weekly" commit-message: - prefix: "build" + prefix: "deps" include: "scope" - package-ecosystem: "github-actions" # Workflow files stored in the default location of `.github/workflows`. (You don't need to specify `/.github/workflows` for `directory`. You can use `directory: "/"`.) diff --git a/.github/workflows/lint-pr.yml b/.github/workflows/lint-pr.yml index ec1d4145..4e2c6706 100644 --- a/.github/workflows/lint-pr.yml +++ b/.github/workflows/lint-pr.yml @@ -12,6 +12,10 @@ jobs: name: Validate PR title runs-on: ubuntu-latest steps: - - uses: amannn/action-semantic-pull-request@v6 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Checkout + uses: actions/checkout@v5 + + - name: Validate PR title + uses: ./.github/actions/validate-pr-title + with: + title: ${{ github.event.pull_request.title }} diff --git a/release-please-config.json b/release-please-config.json index 10ff937d..223cb0fd 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -5,11 +5,5 @@ "release-type": "node", "package-name": "5e-database" } - }, - "changelog-sections": [ - { - "type": "build", - "section": "Dependencies" - } - ] + } }