This repository was archived by the owner on Nov 3, 2026. It is now read-only.
Repository navigation
ci: add notify-downstream workflow #2
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
|
|
||
| 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 | ||
|
coderabbitai[bot] marked this conversation as resolved.
Resolved
Comment on lines
+41
to
+48
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Regex may miss valid conventional commit variants. The pattern
Consider using a more permissive pattern that allows an optional ♻️ 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 |
||
|
|
||
| - 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) }} | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.