Skip to content

chore: restore notify-parent workflow (simplified) - #10

Merged
mateodelnorte merged 1 commit into
mainfrom
fix/restore-notify-parent
Mar 26, 2026
Merged

mateodelnorte merged 1 commit into
mainfrom
fix/restore-notify-parent

Conversation

@mateodelnorte

@mateodelnorte mateodelnorte commented Mar 26, 2026 •

Copy link
Copy Markdown
Contributor

Re-adds notify-parent.yml to trigger parent meta repo's release-please when this child repo merges to main.

Simplified: no commit message parsing, just dispatches repo name and SHA. Companion to gitkb/meta#62.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Added an automated notification for pushes to the main branch to inform the parent repository, streamlining update coordination and reducing manual steps.
    • Notifications include minimal commit metadata (repository name, short commit SHA, and actor) to enable quick tracking without exposing extra details.

@coderabbitai

coderabbitai Bot commented Mar 26, 2026 •

Copy link
Copy Markdown

Warning

Rate limit exceeded

@mateodelnorte has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 0 minutes and 23 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: fa9b3c0f-b3f0-4faa-855c-302af2956949

📥 Commits

Reviewing files that changed from the base of the PR and between 3c3d9b2 and 924b2e5.

📒 Files selected for processing (1)
  • .github/workflows/notify-parent.yml

Walkthrough

Added a GitHub Actions workflow .github/workflows/notify-parent.yml that triggers on pushes to main and dispatches a child-repo-updated repository_dispatch event to harmony-labs/meta with a minimal client_payload (repo_name, short_sha, actor) authenticated via secrets.PARENT_REPO_PAT.

Changes

Cohort / File(s) Summary
New Workflow
​.github/workflows/notify-parent.yml
Adds a workflow triggered on push to main with a single notify job that uses peter-evans/repository-dispatch@v4 to send child-repo-updated to harmony-labs/meta. Payload reduced to repo_name, short_sha, and actor; auth via secrets.PARENT_REPO_PAT.

Sequence Diagram(s)

sequenceDiagram
    participant Push as "Developer Push\n(child repo)"
    participant Actions as "GitHub Actions\nRunner"
    participant Dispatch as "peter-evans/repository-dispatch"
    participant Parent as "harmony-labs/meta\n(Repository Dispatch Receiver)"

    rect rgba(135,206,250,0.5)
    Push->>Actions: push to main triggers workflow
    end

    rect rgba(144,238,144,0.5)
    Actions->>Dispatch: call action with event_type: child-repo-updated\nclient_payload: {repo_name, short_sha, actor}\nauth: secrets.PARENT_REPO_PAT
    end

    rect rgba(255,182,193,0.5)
    Dispatch->>Parent: send repository_dispatch event
    Parent-->>Dispatch: 200 OK (ack)
    end

    Dispatch-->>Actions: action result
    Actions-->>Push: workflow completes
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 I nibbled a branch and gave it a ping,

short payload, quick hop — what joy it will bring.
One push, one bell, the parent will know,
carrots and logs in a tidy row. 🥕✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: restoring a GitHub Actions workflow with a simplified implementation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/restore-notify-parent

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps

greptile-apps Bot commented Mar 26, 2026

Copy link
Copy Markdown

Greptile Summary

This PR re-adds .github/workflows/notify-parent.yml in a stripped-down form: it removes the CI-wait job, the repository_dispatch trigger, and all commit-message parsing, leaving only a single notify job that fires on every push to main and dispatches a child-repo-updated event to harmony-labs/meta with a minimal payload.\n\nKey observations:\n- The field is named short_sha but is populated with ${{ github.sha }}, which is the full 40-character SHA. This is a semantic mismatch with the old behaviour (which used git rev-parse --short HEAD) and may break any consumer in the meta repo that expects an abbreviated ref.\n- The Checkout step is retained but no longer serves a purpose — all payload values are available directly from the GitHub context.\n- short_sha uses manual double-quote wrapping while repo_name and actor use toJSON(), creating inconsistent JSON serialisation in the payload.

Confidence Score: 4/5

Safe to merge after resolving the short_sha naming/value mismatch; the remaining comments are non-blocking style improvements.

The workflow is simple and correctly structured. The P1 concern (field named short_sha contains a full SHA) could break downstream consumers in harmony-labs/meta, so one targeted fix is needed before the companion PR is live. The two P2 comments (unused checkout, inconsistent quoting) are clean-up suggestions and do not block merge on their own.

.github/workflows/notify-parent.yml — specifically the short_sha field value on line 23.

Important Files Changed

Filename Overview
.github/workflows/notify-parent.yml Simplified notify-parent workflow: removes CI wait and commit-type parsing, dispatches only repo_name, short_sha (actually full SHA — naming bug), and actor to harmony-labs/meta.

Sequence Diagram

sequenceDiagram
    participant GH as GitHub (loop_cli)
    participant WF as notify workflow
    participant META as harmony-labs/meta

    GH->>WF: push to main
    WF->>WF: (checkout — currently unused)
    WF->>META: repository_dispatch<br/>event-type: child-repo-updated<br/>payload: {repo_name, short_sha (full SHA), actor}
    META-->>META: trigger release-please
Loading
Prompt To Fix All With AI
This is a comment left during a code review.
Path: .github/workflows/notify-parent.yml
Line: 23

Comment:
**`short_sha` field contains the full SHA**

`${{ github.sha }}` is the full 40-character commit SHA, not a short SHA. The old version used `git rev-parse --short HEAD` to produce the 7-character abbreviated form. If the companion workflow in `harmony-labs/meta#62` reads `short_sha` expecting a short ref (e.g. for display, tagging, or matching logic), it will receive the full SHA instead, which may break those downstream consumers.

```suggestion
              "sha": "${{ github.sha }}",
```

Or, if the short form is truly needed, add a dedicated step to compute it:

```yaml
- name: Compute short SHA
  id: vars
  run: echo "short_sha=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
```

and then use `${{ steps.vars.outputs.short_sha }}`.

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

---

This is a comment left during a code review.
Path: .github/workflows/notify-parent.yml
Line: 11-12

Comment:
**Checkout step is no longer needed**

The simplified workflow doesn't use any files from the repository or run any shell commands that require a checkout. All values (`github.sha`, `github.event.repository.name`, `github.actor`) are available directly from the GitHub context without checking out the code. Removing this step would save a few seconds of CI time per push to `main`.

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

---

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.

Reviews (1): Last reviewed commit: "chore: restore notify-parent workflow (s..." | Re-trigger Greptile

Comment thread .github/workflows/notify-parent.yml Outdated
"type": ${{ toJSON(steps.source.outputs.type) }},
"actor": ${{ toJSON(steps.source.outputs.actor) }}
"repo_name": ${{ toJSON(github.event.repository.name) }},
"short_sha": "${{ github.sha }}",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 short_sha field contains the full SHA

${{ github.sha }} is the full 40-character commit SHA, not a short SHA. The old version used git rev-parse --short HEAD to produce the 7-character abbreviated form. If the companion workflow in harmony-labs/meta#62 reads short_sha expecting a short ref (e.g. for display, tagging, or matching logic), it will receive the full SHA instead, which may break those downstream consumers.

Suggested change
"short_sha": "${{ github.sha }}",
"sha": "${{ github.sha }}",

Or, if the short form is truly needed, add a dedicated step to compute it:

- name: Compute short SHA
  id: vars
  run: echo "short_sha=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"

and then use ${{ steps.vars.outputs.short_sha }}.

Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/notify-parent.yml
Line: 23

Comment:
**`short_sha` field contains the full SHA**

`${{ github.sha }}` is the full 40-character commit SHA, not a short SHA. The old version used `git rev-parse --short HEAD` to produce the 7-character abbreviated form. If the companion workflow in `harmony-labs/meta#62` reads `short_sha` expecting a short ref (e.g. for display, tagging, or matching logic), it will receive the full SHA instead, which may break those downstream consumers.

```suggestion
              "sha": "${{ github.sha }}",
```

Or, if the short form is truly needed, add a dedicated step to compute it:

```yaml
- name: Compute short SHA
  id: vars
  run: echo "short_sha=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
```

and then use `${{ steps.vars.outputs.short_sha }}`.

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.

Comment thread .github/workflows/notify-parent.yml Outdated
Comment on lines 11 to 12
- name: Checkout
uses: actions/checkout@v4

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 Checkout step is no longer needed

The simplified workflow doesn't use any files from the repository or run any shell commands that require a checkout. All values (github.sha, github.event.repository.name, github.actor) are available directly from the GitHub context without checking out the code. Removing this step would save a few seconds of CI time per push to main.

Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/notify-parent.yml
Line: 11-12

Comment:
**Checkout step is no longer needed**

The simplified workflow doesn't use any files from the repository or run any shell commands that require a checkout. All values (`github.sha`, `github.event.repository.name`, `github.actor`) are available directly from the GitHub context without checking out the code. Removing this step would save a few seconds of CI time per push to `main`.

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.

Comment on lines +22 to +24
"repo_name": ${{ toJSON(github.event.repository.name) }},
"short_sha": "${{ github.sha }}",
"actor": ${{ toJSON(github.actor) }}

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.

@mateodelnorte
mateodelnorte force-pushed the fix/restore-notify-parent branch from e0f85d2 to 1054c7a Compare March 26, 2026 12:37

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/notify-parent.yml:
- Line 12: Replace the mutable tag "peter-evans/repository-dispatch@v4" with the
corresponding immutable commit SHA for the release; locate the workflow step
that uses the string "uses: peter-evans/repository-dispatch@v4" and update it to
"uses: peter-evans/repository-dispatch@<COMMIT_SHA>" (the full 40-character
commit) to pin the action to an immutable reference.
- Around line 3-10: Add an explicit least-privilege permissions block to the
workflow to deny unnecessary GITHUB_TOKEN access: update
.github/workflows/notify-parent.yml and add a top-level permissions entry (e.g.,
permissions: none or only the minimal required scopes) so the notify job and the
peter-evans/repository-dispatch@v4 step do not inherit broad GITHUB_TOKEN
permissions; ensure the permissions block is present above the jobs section and
only grants any specific permission if the workflow actually needs it.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 96510449-7554-4938-8bc7-e2b8d13de791

📥 Commits

Reviewing files that changed from the base of the PR and between 9a5465a and 1054c7a.

📒 Files selected for processing (1)
  • .github/workflows/notify-parent.yml

Comment thread .github/workflows/notify-parent.yml
Comment thread .github/workflows/notify-parent.yml Outdated
@mateodelnorte
mateodelnorte force-pushed the fix/restore-notify-parent branch from 1054c7a to 3c3d9b2 Compare March 26, 2026 12:44

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

♻️ Duplicate comments (2)
.github/workflows/notify-parent.yml (2)

7-9: ⚠️ Potential issue | 🟠 Major

Add explicit least-privilege workflow permissions.

This workflow does not need GITHUB_TOKEN scopes for the dispatch step (it uses secrets.PARENT_REPO_PAT), so declare explicit minimal permissions to avoid inherited defaults.

Suggested fix
 on:
   push:
     branches: [main]
 
+permissions: {}
+
 jobs:
   notify:
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/notify-parent.yml around lines 7 - 9, The workflow is
missing explicit least-privilege permissions, so add an explicit permissions
block (e.g. set permissions: none or the minimal required scopes) to avoid
inheriting broader GITHUB_TOKEN rights; update the workflow (job named "notify"
in notify-parent.yml) by adding a permissions entry either at the top-level or
under jobs.notify (e.g. jobs.notify.permissions: none) so the workflow does not
grant unnecessary token scopes.

12-12: ⚠️ Potential issue | 🟠 Major

Pin peter-evans/repository-dispatch to an immutable full commit SHA.

Line 12 currently uses a mutable tag (@v4), which weakens supply-chain integrity.

Suggested fix
-        uses: peter-evans/repository-dispatch@v4
+        uses: peter-evans/repository-dispatch@<FULL_40_CHAR_COMMIT_SHA>

Use this read-only script to resolve the current v4 tag to its full commit SHA before updating:

#!/bin/bash
set -euo pipefail

echo "Current workflow ref:"
rg -n 'uses:\s*peter-evans/repository-dispatch@' .github/workflows/notify-parent.yml

echo
echo "Resolved full commit SHA for tag v4:"
obj_type=$(gh api repos/peter-evans/repository-dispatch/git/ref/tags/v4 --jq '.object.type')
obj_sha=$(gh api repos/peter-evans/repository-dispatch/git/ref/tags/v4 --jq '.object.sha')
if [ "$obj_type" = "tag" ]; then
  gh api repos/peter-evans/repository-dispatch/git/tags/"$obj_sha" --jq '.object.sha'
else
  echo "$obj_sha"
fi
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/notify-parent.yml at line 12, The workflow currently pins
the step using the mutable tag "uses: peter-evans/repository-dispatch@v4";
replace that with the repository-dispatch action's immutable full commit SHA
instead (resolve the SHA for tag v4 via the GitHub API or the provided script)
and update the "uses: peter-evans/repository-dispatch@<sha>" line so the action
is referenced by its full commit SHA rather than the `@v4` tag.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In @.github/workflows/notify-parent.yml:
- Around line 7-9: The workflow is missing explicit least-privilege permissions,
so add an explicit permissions block (e.g. set permissions: none or the minimal
required scopes) to avoid inheriting broader GITHUB_TOKEN rights; update the
workflow (job named "notify" in notify-parent.yml) by adding a permissions entry
either at the top-level or under jobs.notify (e.g. jobs.notify.permissions:
none) so the workflow does not grant unnecessary token scopes.
- Line 12: The workflow currently pins the step using the mutable tag "uses:
peter-evans/repository-dispatch@v4"; replace that with the repository-dispatch
action's immutable full commit SHA instead (resolve the SHA for tag v4 via the
GitHub API or the provided script) and update the "uses:
peter-evans/repository-dispatch@<sha>" line so the action is referenced by its
full commit SHA rather than the `@v4` tag.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: e33f9285-4d5a-415e-b067-abca33acfb81

📥 Commits

Reviewing files that changed from the base of the PR and between 1054c7a and 3c3d9b2.

📒 Files selected for processing (1)
  • .github/workflows/notify-parent.yml

@mateodelnorte
mateodelnorte force-pushed the fix/restore-notify-parent branch from 3c3d9b2 to 9662505 Compare March 26, 2026 13:02
Re-adds notify-parent.yml to trigger parent meta repo's release-please
when this child repo merges to main.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mateodelnorte
mateodelnorte force-pushed the fix/restore-notify-parent branch from 9662505 to 924b2e5 Compare March 26, 2026 13:21
@mateodelnorte
mateodelnorte merged commit 665ea75 into main Mar 26, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant