Skip to content
This repository was archived by the owner on Nov 3, 2026. It is now read-only.
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
18 changes: 18 additions & 0 deletions .github/workflows/auto-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,35 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref || github.ref_name }}
path: meta_plugin_protocol
# Use PAT to trigger downstream workflows; fallback to GITHUB_TOKEN
token: ${{ secrets.PARENT_REPO_PAT || github.token }}

- name: Create workspace Cargo.toml
run: |
cat > Cargo.toml << 'EOF'
[workspace]
members = ["meta_plugin_protocol"]
resolver = "2"

[workspace.package]
version = "0.1.0"
edition = "2021"
license = "MIT"
repository = "https://github.com/harmony-labs/meta"
EOF

- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt

- name: Run cargo fmt
working-directory: meta_plugin_protocol
run: cargo fmt --all

- name: Check for changes
id: changes
working-directory: meta_plugin_protocol
run: |
if git diff --quiet; then
echo "formatted=false" >> $GITHUB_OUTPUT
Expand All @@ -48,6 +65,7 @@ jobs:

- name: Commit and push
if: steps.changes.outputs.formatted == 'true'
working-directory: meta_plugin_protocol
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,34 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v6
with:
path: meta_plugin_protocol

- name: Create workspace Cargo.toml
shell: bash
run: |
cat > Cargo.toml << 'EOF'
[workspace]
members = ["meta_plugin_protocol"]
resolver = "2"

[workspace.package]
version = "0.1.0"
edition = "2021"
license = "MIT"
repository = "https://github.com/harmony-labs/meta"
EOF

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Cache Rust
uses: Swatinem/rust-cache@v2
with:
workspaces: meta_plugin_protocol

- name: Run tests
working-directory: meta_plugin_protocol
run: cargo test --all-features

clippy:
Expand All @@ -36,6 +56,22 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v6
with:
path: meta_plugin_protocol

- name: Create workspace Cargo.toml
run: |
cat > Cargo.toml << 'EOF'
[workspace]
members = ["meta_plugin_protocol"]
resolver = "2"

[workspace.package]
version = "0.1.0"
edition = "2021"
license = "MIT"
repository = "https://github.com/harmony-labs/meta"
EOF

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
Expand All @@ -44,8 +80,11 @@ jobs:

- name: Cache Rust
uses: Swatinem/rust-cache@v2
with:
workspaces: meta_plugin_protocol

- name: Run clippy
working-directory: meta_plugin_protocol
run: cargo clippy --all-targets --all-features -- -D warnings

format:
Expand All @@ -54,11 +93,28 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v6
with:
path: meta_plugin_protocol

- name: Create workspace Cargo.toml
run: |
cat > Cargo.toml << 'EOF'
[workspace]
members = ["meta_plugin_protocol"]
resolver = "2"

[workspace.package]
version = "0.1.0"
edition = "2021"
license = "MIT"
repository = "https://github.com/harmony-labs/meta"
EOF

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt

- name: Check formatting
working-directory: meta_plugin_protocol
run: cargo fmt --all -- --check
65 changes: 65 additions & 0 deletions .github/workflows/notify-downstream.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Notify Downstream

on:
push:
branches: [main]

jobs:
wait-for-ci:
runs-on: ubuntu-latest
steps:
- name: Wait for CI
uses: lewagon/wait-on-check-action@v1.5.0
with:
ref: ${{ github.sha }}
check-name: 'Test (ubuntu-latest)'
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 10
Comment thread
mateodelnorte marked this conversation as resolved.
Resolved

notify:
needs: wait-for-ci
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
downstream:
- meta_cli
- meta_git_cli
- 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
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
Comment on lines +41 to +48

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Regex may miss valid conventional commit variants.

The pattern ^feat[:(] requires the type to be immediately followed by : or (. This misses valid conventional commit formats like:

  • feat!: breaking change (breaking change indicator)
  • feat!(<scope>): message (breaking change with scope)

Consider using a more permissive pattern that allows an optional ! before the delimiter:

♻️ Proposed fix
-          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
+          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
🤖 Prompt for AI Agents
In @.github/workflows/notify-downstream.yml around lines 41 - 48, The
conditional regexes that test MSG (the if/elif block that echoes type based on
commit message) are too strict and miss variants with a breaking-change bang
(e.g., feat! or feat!(scope)): update each pattern (the tests for "feat", "fix",
"chore", "docs", "test", "refactor") to allow an optional "!" immediately after
the type before the delimiter by inserting an optional-bang token between the
type and the delimiter (so the pattern accepts e.g. feat!, feat!(scope), feat:,
feat(scope), etc.); keep the rest of the match (delimiter check) the same and
apply the same change for all listed types in that if/elif block.


- name: Notify ${{ matrix.downstream }}
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.PARENT_REPO_PAT }}
repository: harmony-labs/${{ matrix.downstream }}
event-type: dependency-updated
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) }},
"actor": ${{ toJSON(github.actor) }}
}