Repository navigation
chore: restore notify-parent workflow (simplified) #10
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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: | ||||||||||||||
| - 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
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.
Suggested change
Prompt To Fix With AIThis 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.
Contributor
Author
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. Fixed in 1054c7a.
Contributor
Author
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. Fixed — renamed short_sha to sha (sender sends full SHA, parent truncates to 7 chars), removed checkout step, added permissions: {} block. |
||||||||||||||
| } | ||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.