From a659db58e429f7bd87fba81ae68dd9d3d8041f1b Mon Sep 17 00:00:00 2001 From: Matt Walters Date: Wed, 25 Mar 2026 13:54:27 -0500 Subject: [PATCH 1/3] fix: simplify notify-downstream workflow Remove broken commit message parsing that failed on subjects containing parentheses (e.g., merge commits with PR numbers). The bash regex matching in `MSG=$(git log -1 --pretty=%s)` would break when the subject contained unbalanced parens. Simplified to just dispatch the event with repo, sha, and actor. No checkout, no commit parsing. Also: - Skip wait-for-ci on forwarded dispatches - Upgrade peter-evans/repository-dispatch to v4 Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/notify-downstream.yml | 32 ++++++------------------- 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/.github/workflows/notify-downstream.yml b/.github/workflows/notify-downstream.yml index 13f8124..d9e37ad 100644 --- a/.github/workflows/notify-downstream.yml +++ b/.github/workflows/notify-downstream.yml @@ -3,9 +3,13 @@ name: Notify Downstream on: push: branches: [main] + repository_dispatch: + types: [dependency-updated] jobs: wait-for-ci: + # Only wait when triggered by our own push (not a forwarded dispatch) + if: github.event_name == 'push' runs-on: ubuntu-latest steps: - name: Wait for CI @@ -17,6 +21,7 @@ jobs: wait-interval: 10 notify: + if: always() && (needs.wait-for-ci.result == 'success' || needs.wait-for-ci.result == 'skipped') needs: wait-for-ci runs-on: ubuntu-latest strategy: @@ -28,27 +33,8 @@ jobs: - meta_project_cli - meta_rust_cli steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Extract commit info - id: commit - run: | - MSG=$(git log -1 --pretty=%s) - echo "message=$MSG" >> $GITHUB_OUTPUT - echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT - echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - if [[ "$MSG" =~ ^feat[:(] ]]; then echo "type=feat" >> $GITHUB_OUTPUT - elif [[ "$MSG" =~ ^fix[:(] ]]; then echo "type=fix" >> $GITHUB_OUTPUT - elif [[ "$MSG" =~ ^chore[:(] ]]; then echo "type=chore" >> $GITHUB_OUTPUT - elif [[ "$MSG" =~ ^docs[:(] ]]; then echo "type=docs" >> $GITHUB_OUTPUT - elif [[ "$MSG" =~ ^test[:(] ]]; then echo "type=test" >> $GITHUB_OUTPUT - elif [[ "$MSG" =~ ^refactor[:(] ]]; then echo "type=refactor" >> $GITHUB_OUTPUT - else echo "type=other" >> $GITHUB_OUTPUT - fi - - name: Notify ${{ matrix.downstream }} - uses: peter-evans/repository-dispatch@v3 + uses: peter-evans/repository-dispatch@v4 with: token: ${{ secrets.PARENT_REPO_PAT }} repository: harmony-labs/${{ matrix.downstream }} @@ -56,10 +42,6 @@ jobs: client-payload: >- { "repo": ${{ toJSON(github.repository) }}, - "repo_name": ${{ toJSON(github.event.repository.name) }}, - "sha": ${{ toJSON(steps.commit.outputs.sha) }}, - "short_sha": ${{ toJSON(steps.commit.outputs.short_sha) }}, - "message": ${{ toJSON(steps.commit.outputs.message) }}, - "type": ${{ toJSON(steps.commit.outputs.type) }}, + "sha": ${{ toJSON(github.sha) }}, "actor": ${{ toJSON(github.actor) }} } From 428316d3f8d93bd2172e47155232f3be2415ae48 Mon Sep 17 00:00:00 2001 From: Matt Walters Date: Wed, 25 Mar 2026 14:18:03 -0500 Subject: [PATCH 2/3] fix: restore full payload, prevent cascade loops, fix commit message parsing --- .github/workflows/notify-downstream.yml | 54 +++++++++++++++++++++---- 1 file changed, 46 insertions(+), 8 deletions(-) diff --git a/.github/workflows/notify-downstream.yml b/.github/workflows/notify-downstream.yml index d9e37ad..e188781 100644 --- a/.github/workflows/notify-downstream.yml +++ b/.github/workflows/notify-downstream.yml @@ -3,13 +3,9 @@ name: Notify Downstream on: push: branches: [main] - repository_dispatch: - types: [dependency-updated] jobs: wait-for-ci: - # Only wait when triggered by our own push (not a forwarded dispatch) - if: github.event_name == 'push' runs-on: ubuntu-latest steps: - name: Wait for CI @@ -21,7 +17,6 @@ jobs: wait-interval: 10 notify: - if: always() && (needs.wait-for-ci.result == 'success' || needs.wait-for-ci.result == 'skipped') needs: wait-for-ci runs-on: ubuntu-latest strategy: @@ -33,6 +28,45 @@ jobs: - meta_project_cli - meta_rust_cli steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Extract commit info + id: commit + env: + GH_REPOSITORY: ${{ github.repository }} + GH_REPO_NAME: ${{ github.event.repository.name }} + GH_ACTOR: ${{ github.actor }} + run: | + write_output() { + local key="$1" value="$2" + local delim="__EOF__$(date +%s%N)_$RANDOM" + { + printf '%s<<%s\n' "$key" "$delim" + printf '%s\n' "$value" + printf '%s\n' "$delim" + } >> "$GITHUB_OUTPUT" + } + + MSG=$(git log -1 --pretty=%s) + write_output message "$MSG" + write_output repo "$GH_REPOSITORY" + write_output repo_name "$GH_REPO_NAME" + write_output actor "$GH_ACTOR" + write_output sha "$(git rev-parse HEAD)" + write_output short_sha "$(git rev-parse --short HEAD)" + + re_feat='^feat[:(]'; re_fix='^fix[:(]'; re_chore='^chore[:(]' + re_docs='^docs[:(]'; re_test='^test[:(]'; re_refactor='^refactor[:(]' + if [[ "$MSG" =~ $re_feat ]]; then write_output type "feat" + elif [[ "$MSG" =~ $re_fix ]]; then write_output type "fix" + elif [[ "$MSG" =~ $re_chore ]]; then write_output type "chore" + elif [[ "$MSG" =~ $re_docs ]]; then write_output type "docs" + elif [[ "$MSG" =~ $re_test ]]; then write_output type "test" + elif [[ "$MSG" =~ $re_refactor ]]; then write_output type "refactor" + else write_output type "other" + fi + - name: Notify ${{ matrix.downstream }} uses: peter-evans/repository-dispatch@v4 with: @@ -41,7 +75,11 @@ jobs: event-type: dependency-updated client-payload: >- { - "repo": ${{ toJSON(github.repository) }}, - "sha": ${{ toJSON(github.sha) }}, - "actor": ${{ toJSON(github.actor) }} + "repo": ${{ toJSON(steps.commit.outputs.repo) }}, + "repo_name": ${{ toJSON(steps.commit.outputs.repo_name) }}, + "sha": ${{ toJSON(steps.commit.outputs.sha) }}, + "short_sha": ${{ toJSON(steps.commit.outputs.short_sha) }}, + "message": ${{ toJSON(steps.commit.outputs.message) }}, + "type": ${{ toJSON(steps.commit.outputs.type) }}, + "actor": ${{ toJSON(steps.commit.outputs.actor) }} } From 6b8b4573bf66476c2f708c27a49302df9d5cd5af Mon Sep 17 00:00:00 2001 From: Matt Walters Date: Wed, 25 Mar 2026 14:30:33 -0500 Subject: [PATCH 3/3] fix: handle breaking change syntax in commit type detection Add `!` to regex character class so `feat!:`, `fix(scope)!:` etc. are correctly categorized instead of falling through to "other". Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/notify-downstream.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/notify-downstream.yml b/.github/workflows/notify-downstream.yml index e188781..852e835 100644 --- a/.github/workflows/notify-downstream.yml +++ b/.github/workflows/notify-downstream.yml @@ -56,8 +56,8 @@ jobs: write_output sha "$(git rev-parse HEAD)" write_output short_sha "$(git rev-parse --short HEAD)" - re_feat='^feat[:(]'; re_fix='^fix[:(]'; re_chore='^chore[:(]' - re_docs='^docs[:(]'; re_test='^test[:(]'; re_refactor='^refactor[:(]' + re_feat='^feat[!:(]'; re_fix='^fix[!:(]'; re_chore='^chore[!:(]' + re_docs='^docs[!:(]'; re_test='^test[!:(]'; re_refactor='^refactor[!:(]' if [[ "$MSG" =~ $re_feat ]]; then write_output type "feat" elif [[ "$MSG" =~ $re_fix ]]; then write_output type "fix" elif [[ "$MSG" =~ $re_chore ]]; then write_output type "chore"