Skip to content
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
15 changes: 15 additions & 0 deletions .github/conventional-subject.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -euo pipefail

status=0

while IFS= read -r subject; do
[ -n "$subject" ] || continue

if ! printf '%s' "$subject" | grep -qE '^(chore|feat|fix)(\([a-z0-9._-]+\))?!?: .+'; then
echo "::error::\"$subject\" must start with chore:, feat: or fix:, optionally scoped. Squash merging takes the pull request title as the commit subject, and release-please only recognises those three types."
status=1
fi
done

exit $status
2 changes: 1 addition & 1 deletion .github/release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{
"type": "chore",
"section": "Miscellaneous",
"hidden": true
"hidden": false
}
],
"plugins": [
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/main-subjects.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Main subjects

on:
push:
branches:
- main

permissions:
contents: read

jobs:
conventional:
name: Landed commit types
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a37ce9120846195fa4ece8f58b268e6043cb2f26 # v3.7.0
with:
fetch-depth: 0

- name: Check the landed subjects
env:
BEFORE: ${{ github.event.before }}
AFTER: ${{ github.sha }}
run: |
if git cat-file -e "$BEFORE^{commit}" 2>/dev/null; then
revisions=("$BEFORE..$AFTER")
else
revisions=(--max-count=1 "$AFTER")
fi

git log --no-merges --format=%s "${revisions[@]}" | .github/conventional-subject.sh
24 changes: 24 additions & 0 deletions .github/workflows/pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: PR title

on:
pull_request:
types:
- opened
- edited
- reopened
Comment thread
cursor[bot] marked this conversation as resolved.
- synchronize

permissions:
contents: read

jobs:
conventional:
name: Conventional commit type
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a37ce9120846195fa4ece8f58b268e6043cb2f26 # v3.7.0

- name: Check the title
env:
TITLE: ${{ github.event.pull_request.title }}
run: printf '%s\n' "$TITLE" | .github/conventional-subject.sh
Loading