Skip to content
Merged
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
26 changes: 26 additions & 0 deletions .github/workflows/notify-parent.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Notify Parent Repo

on:
push:
branches: [main]

permissions: {}

jobs:
notify:
runs-on: ubuntu-latest
steps:
Comment thread
coderabbitai[bot] marked this conversation as resolved.
- name: Notify parent repo
# PARENT_REPO_PAT requires `repo` scope (or fine-grained `contents:write`)
# on harmony-labs/meta. Configure in Settings → Secrets → Actions.
uses: peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697 # v4
with:
token: ${{ secrets.PARENT_REPO_PAT }}
repository: harmony-labs/meta
event-type: child-repo-updated
client-payload: >-
{
"repo_name": ${{ toJSON(github.event.repository.name) }},
"sha": ${{ toJSON(github.sha) }},
"actor": ${{ toJSON(github.actor) }}
Comment on lines +23 to +25

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Inconsistent JSON string quoting

repo_name and actor use toJSON() to produce properly-escaped JSON strings (e.g. "loop_cli"), but short_sha uses manual double-quote wrapping ("${{ github.sha }}"). While a hex SHA is safe from escaping issues in practice, it's inconsistent and would silently produce malformed JSON if the value ever contained special characters.

Suggested change
"repo_name": ${{ toJSON(github.event.repository.name) }},
"short_sha": "${{ github.sha }}",
"actor": ${{ toJSON(github.actor) }}
"repo_name": ${{ toJSON(github.event.repository.name) }},
"short_sha": ${{ toJSON(github.sha) }},
"actor": ${{ toJSON(github.actor) }}
Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/notify-parent.yml
Line: 22-24

Comment:
**Inconsistent JSON string quoting**

`repo_name` and `actor` use `toJSON()` to produce properly-escaped JSON strings (e.g. `"loop_cli"`), but `short_sha` uses manual double-quote wrapping (`"${{ github.sha }}"`). While a hex SHA is safe from escaping issues in practice, it's inconsistent and would silently produce malformed JSON if the value ever contained special characters.

```suggestion
              "repo_name": ${{ toJSON(github.event.repository.name) }},
              "short_sha": ${{ toJSON(github.sha) }},
              "actor": ${{ toJSON(github.actor) }}
```

How can I resolve this? If you propose a fix, please make it concise.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 1054c7a.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed — renamed short_sha to sha (sender sends full SHA, parent truncates to 7 chars), removed checkout step, added permissions: {} block.

}
Loading