diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 768fdad..ca82506 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,24 +5,12 @@ on: branches: - main pull_request: - types: [opened, edited, synchronize, reopened] + types: [opened, synchronize, reopened] jobs: test: runs-on: blacksmith-4vcpu-ubuntu-2404 steps: - - name: Validate Conventional Commit title - if: github.event_name == 'pull_request' - env: - PR_TITLE: ${{ github.event.pull_request.title }} - shell: bash - run: | - pattern='^[a-z][a-z0-9-]*(\([^()]+\))?(!)?: .+' - if [[ ! $PR_TITLE =~ $pattern ]]; then - echo "Pull request titles must use Conventional Commit syntax." >&2 - echo "Examples: feat: add a feature, fix(api): correct behavior, feat!: break compatibility" >&2 - exit 1 - fi - uses: useblacksmith/checkout@v1 - uses: dtolnay/rust-toolchain@master with: diff --git a/.github/workflows/pr-title.yml b/.github/workflows/pr-title.yml new file mode 100644 index 0000000..b463fa5 --- /dev/null +++ b/.github/workflows/pr-title.yml @@ -0,0 +1,21 @@ +name: pr-title + +on: + pull_request: + types: [opened, edited, synchronize, reopened] + +jobs: + pr-title: + runs-on: blacksmith-4vcpu-ubuntu-2404 + steps: + - name: Validate Conventional Commit title + env: + PR_TITLE: ${{ github.event.pull_request.title }} + shell: bash + run: | + pattern='^[a-z][a-z0-9-]*(\([^()]+\))?(!)?: .+' + if [[ ! $PR_TITLE =~ $pattern ]]; then + echo "Pull request titles must use Conventional Commit syntax." >&2 + echo "Examples: feat: add a feature, fix(api): correct behavior, feat!: break compatibility" >&2 + exit 1 + fi