From f2bd0994a84606489ff8b341d62ac0140c95a34f Mon Sep 17 00:00:00 2001 From: Matt Walters Date: Sun, 29 Mar 2026 11:49:42 -0500 Subject: [PATCH] fix: propagate conventional commit type from child repo to sync PR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of hardcoding feat: or fix:, fetch the child commit message via gh api and extract the conventional commit type. This means: - Child fix: commits → fix(repo): sync → patch bump - Child feat: commits → feat(repo): sync → minor bump (post-1.0) - Non-release types (chore, docs, etc.) → promoted to fix: so syncs always trigger a release Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/on-child-update.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/on-child-update.yml b/.github/workflows/on-child-update.yml index ba3258b..470e706 100644 --- a/.github/workflows/on-child-update.yml +++ b/.github/workflows/on-child-update.yml @@ -34,8 +34,20 @@ jobs: SHORT_SHA="${FULL_SHA:0:7}" SHORT_SHA="${SHORT_SHA:-$(date +%s | tail -c 8)}" + # Extract conventional commit type from child commit message. + # Falls back to "fix" if the message doesn't follow conventional commits. + COMMIT_MSG=$(gh api "repos/harmony-labs/${REPO_NAME}/commits/${FULL_SHA}" \ + --jq '.commit.message' 2>/dev/null | head -1) + COMMIT_TYPE=$(echo "$COMMIT_MSG" | grep -oE '^(feat|fix|perf|refactor|docs|test|chore|ci|build|style)' | head -1) + COMMIT_TYPE="${COMMIT_TYPE:-fix}" + # chore/docs/test/ci/style/build don't trigger release-please — promote to fix + case "$COMMIT_TYPE" in + feat|fix|perf) ;; + *) COMMIT_TYPE="fix" ;; + esac + BRANCH="sync/${REPO_NAME}/${SHORT_SHA}" - PR_TITLE="feat(${REPO_NAME}): sync ${SHORT_SHA}" + PR_TITLE="${COMMIT_TYPE}(${REPO_NAME}): sync ${SHORT_SHA}" # Check for existing branch if git ls-remote --exit-code origin "refs/heads/$BRANCH" >/dev/null 2>&1; then