From fa35db7a54e3206fafd2f31484c7f3a38af51caa Mon Sep 17 00:00:00 2001 From: Yuriy Kirillov Date: Wed, 12 Aug 2026 15:09:38 +0200 Subject: [PATCH] refactor: internalize pull request title check --- .github/workflows/commit.yml | 7 ---- .../workflows/{commit-shared.yml => pr.yml} | 5 +-- AGENTS.md | 3 +- README.md | 33 ++----------------- 4 files changed, 7 insertions(+), 41 deletions(-) delete mode 100644 .github/workflows/commit.yml rename .github/workflows/{commit-shared.yml => pr.yml} (70%) diff --git a/.github/workflows/commit.yml b/.github/workflows/commit.yml deleted file mode 100644 index dddfb55..0000000 --- a/.github/workflows/commit.yml +++ /dev/null @@ -1,7 +0,0 @@ -name: Commit -on: - pull_request_target: - types: [opened, reopened, edited, synchronize] -jobs: - pull-request-title: - uses: ./.github/workflows/commit-shared.yml diff --git a/.github/workflows/commit-shared.yml b/.github/workflows/pr.yml similarity index 70% rename from .github/workflows/commit-shared.yml rename to .github/workflows/pr.yml index 8e6d782..1806c87 100644 --- a/.github/workflows/commit-shared.yml +++ b/.github/workflows/pr.yml @@ -1,6 +1,7 @@ -name: Commit (shared) +name: Pull request on: - workflow_call: + pull_request_target: + types: [opened, reopened, edited, synchronize] jobs: pull-request-title: runs-on: ubuntu-slim diff --git a/AGENTS.md b/AGENTS.md index c4cce08..d1d43b7 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -70,9 +70,8 @@ tools to already be installed in the developer environment. - `.github/actions/check-precommit/` — composite action: verifies pre-commit hooks match detected CI linters - `.github/actions/setup-runtimes/` — installs Python packages, Ruby, and standalone binaries for requested linters; Python is provided by the runner - `.github/workflows/lint-shared.yml` — reusable workflow exported for consuming repos: setup + lint -- `.github/workflows/commit-shared.yml` — reusable workflow exported for Conventional Commit pull request titles - `.github/workflows/embedder-shared.yml` — reusable workflow exported for required content validation -- `.github/workflows/commit.yml` — baseline caller for its Conventional Commit pull request title check +- `.github/workflows/pr.yml` — validates Baseline pull request titles against Conventional Commits - `.github/workflows/lint.yml` — baseline self-lint (uses local `./` references, not `@vX`) - `.github/workflows/release-please.yml` — maintains the release PR and publishes merged releases - `.github/workflows/notify-telegram-unreleased.yml` — baseline's own caller (delegates to `rubykatzen/releaser`) diff --git a/README.md b/README.md index 2b60213..cd6567b 100644 --- a/README.md +++ b/README.md @@ -77,34 +77,7 @@ jobs: The `skip` input must be a JSON array. Unknown check names fail the workflow. -### 3. Commit workflow - -Create `.github/workflows/commit.yml`: - -```yaml -name: Commit -on: - # Load trusted workflow code from the default branch when validating fork PRs. - pull_request_target: - types: [opened, reopened, edited, synchronize] -jobs: - pull-request-title: - uses: rubykatzen/baseline/.github/workflows/commit-shared.yml@VERSION -``` - -The shared workflow requires pull request titles to follow Conventional Commits: - -```text -[optional scope][!]: -``` - -Only the pull request title is validated. Intermediate branch commits may use -any format because the GitHub repository policy squashes the pull request and -uses only its title for the single commit added to the default branch. Use `!` -for a breaking change, for example -`refactor!: remove legacy workflow inputs`. - -### 4. Embedded content +### 3. Embedded content Create `.github/workflows/embedder.yml`: @@ -138,7 +111,7 @@ jobs: The `skip` input must be a JSON array. Unknown fragment names fail the workflow. -### 5. Pre-commit hooks +### 4. Pre-commit hooks Copy `.pre-commit-config.yaml.example` to your repo or add to your existing config. Include only the hooks relevant to your stack: @@ -170,7 +143,7 @@ Ruby hooks use `bundle exec`; install Ruby and run `bundle install` in the consuming repository first. `rubocop` and `erb_lint` must be available through the [`rubykatzen-baseline`](#ruby-gem-rubocop--erb_lint) gem. -### 6. Dependabot +### 5. Dependabot Add `.github/dependabot.yml` to keep GitHub Actions and pre-commit pins current automatically: