Conversation
This comment has been minimized.
This comment has been minimized.
|
Hey That said, this PR is currently a [WIP] draft with no code changes yet (the single "Initial plan" commit has 0 files and 0 lines changed). Before it's ready for review, here are the things to address:
Use
|
…on_comment event When triggered by a `discussion_comment` event without an explicit `item_number`, `add_comment` now posts a threaded reply to the triggering comment instead of creating a new top-level discussion comment. The `replyToId` is derived from `context.payload?.comment?.node_id` and passed to `commentOnDiscussion()`. When an explicit `item_number` is provided, the behavior is unchanged (top-level comment). Fixes: #allow-commenting-editing-posts Agent-Logs-Url: https://github.com/github/gh-aw/sessions/51ca4e81-4946-4fa0-a5a0-04063662c3b8 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Fixes add_comment so that when invoked from a discussion_comment workflow event (and no explicit item_number is provided), the action posts a threaded reply to the triggering discussion comment instead of creating a new top-level discussion comment.
Changes:
- Derive
replyToIdfromcontext.payload.comment.node_idfordiscussion_commentevents (whenmessage.item_numberis not explicitly set) and pass it tocommentOnDiscussion(). - Add tests to verify (1) threaded replies for
discussion_commenttrigger context and (2) non-threaded behavior whenitem_numberis explicitly provided (via 404-to-discussion fallback).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| actions/setup/js/add_comment.cjs | Uses triggering discussion comment node_id as replyToId to create threaded replies for discussion_comment events. |
| actions/setup/js/add_comment.test.cjs | Adds coverage for threaded reply behavior and ensures explicit item_number keeps comments top-level. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
add_commentalways posted top-level discussion comments, even when triggered by adiscussion_commentevent — making agent replies appear disconnected from the comment they were responding to.Changes
add_comment.cjs: When the triggering event isdiscussion_commentand no explicititem_numberis provided, derivereplyToIdfromcontext.payload?.comment?.node_idand pass it tocommentOnDiscussion(). The threading infrastructure was already in place; it just wasn't being used.add_comment.test.cjs: Two new tests covering the triggering-context threading path and the explicit-item_numbernon-threaded path.Behavior matrix
item_numberdiscussion_commentdiscussion_commentdiscussionWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/graphql/usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw go-udiff@v0.4.1/rev-parse 64/pkg/tool/linu--show-toplevel git rev-�� --show-toplevel 64/pkg/tool/linux_amd64/vet /usr/bin/git se .cfg ache/go/1.25.0/x--show-toplevel git(http block)https://api.github.com/orgs/test-owner/actions/secrets/usr/bin/gh gh api /orgs/test-owner/actions/secrets --jq .secrets[].name bose(http block)https://api.github.com/repos/actions/ai-inference/git/ref/tags/v1/usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha --show-toplevel x_amd64/vet /opt/hostedtoolcache/node/24.14.0/x64/bin/node ub/workflows committer.email x_amd64/vet node /tmp�� v1.0.0 x_amd64/vet /usr/bin/git */*.json' '!../.git main x_amd64/vet /usr/bin/git(http block)https://api.github.com/repos/actions/checkout/git/ref/tags/v3/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha -bool -buildtags om/testowner/testrepo.git -errorsas -ifaceassert -nilfunc /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/compile -o /tmp/go-build3991629093/b420/_pkg_.a -trimpath /usr/bin/git -p main -lang=go1.25 git(http block)https://api.github.com/repos/actions/checkout/git/ref/tags/v5/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha te 'scripts/**/*.js' --ignore-path .prettierigno-errorsas add_comment.test.cjs 64/pkg/tool/linux_amd64/vet(http block)/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha env.NODE_VERSION x_amd64/vet /usr/bin/git(http block)/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha --show-toplevel ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet /usr/bin/git npx prettier --wgit(http block)https://api.github.com/repos/actions/checkout/git/ref/tags/v6/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha --show-toplevel git r,url,status,conclusion,workflowName,createdAt,startedAt,updated-nilfunc rt/yaml/yaml_defgit flow x_amd64/compile git rev-�� 0:00Z x_amd64/compile /usr/bin/git '**/*.ts' '**/*.git user.name x_amd64/vet git(http block)/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha -bool -buildtags /usr/bin/git -errorsas -ifaceassert -nilfunc git remo�� add origin /opt/hostedtoolcache/node/24.14.0/x64/bin/node '**/*.ts' '**/*.git pull.rebase x_amd64/vet node(http block)/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha --show-toplevel ache/go/1.25.0/x-d /usr/bin/git Onlymin-integritgit(http block)https://api.github.com/repos/actions/github-script/git/ref/tags/v8/usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha(http block)/usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha submodules | hea-errorsas --global t http.https://git/opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet(http block)/usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha submodules | hea-c=4 --global cal/bin/git http.https://git/opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet(http block)https://api.github.com/repos/actions/setup-go/git/ref/tags/v4/usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha /repos/actions/github-script/git/ref/tags/v8 resolved$ /usr/bin/git )$/\1/p --local x_amd64/vet git rese�� HEAD .github/workflows/test.md /usr/bin/git '**/*.ts' '**/*.git pull.rebase x_amd64/vet git(http block)https://api.github.com/repos/actions/setup-node/git/ref/tags/v4/usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha /tmp/shared-actions-test836700347 rev-parse /usr/bin/git /\1/p --local x_amd64/vet git -C /tmp/gh-aw-test-runs/20260401-054141-13690/test-1728879965 status /usr/bin/git .github/workflowgit pull.rebase x_amd64/vet git(http block)https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v0.1.2/usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v0.1.2 --jq .object.sha k/gh-aw/gh-aw/.github/workflows/audit-workflows.md git /usr/bin/git ../pkg/workflow/git --local x_amd64/vet git -C /tmp/gh-aw-test-runs/20260401-054141-13690/test-1728879965 rev-parse /usr/bin/git @{u} user.name x_amd64/vet git(http block)https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v1.0.0/usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.0.0 --jq .object.sha KalLpCxFj /tmp/go-build3991629093/b116/vet.cfg 1629093/b402/_pkg_.a l(http block)https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v1.2.3/usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.2.3 --jq .object.sha 4141-13690/test-1728879965 /tmp/go-build3991629093/b154/vet.cfg 1629093/b126/vet.cfg(http block)https://api.github.com/repos/github/gh-aw/actions/runs/1/artifacts/usr/bin/gh gh run download 1 --dir test-logs/run-1(http block)https://api.github.com/repos/github/gh-aw/actions/runs/12345/artifacts/usr/bin/gh gh run download 12345 --dir test-logs/run-12345(http block)https://api.github.com/repos/github/gh-aw/actions/runs/12346/artifacts/usr/bin/gh gh run download 12346 --dir test-logs/run-12346 /var/lib/waagent/Microsoft.CPlat-ifaceassert x_amd64/compile ignore(http block)https://api.github.com/repos/github/gh-aw/actions/runs/2/artifacts/usr/bin/gh gh run download 2 --dir test-logs/run-2(http block)https://api.github.com/repos/github/gh-aw/actions/runs/3/artifacts/usr/bin/gh gh run download 3 --dir test-logs/run-3(http block)https://api.github.com/repos/github/gh-aw/actions/runs/4/artifacts/usr/bin/gh gh run download 4 --dir test-logs/run-4(http block)https://api.github.com/repos/github/gh-aw/actions/runs/5/artifacts/usr/bin/gh gh run download 5 --dir test-logs/run-5 .cjs 64/pkg/tool/linux_amd64/vet(http block)https://api.github.com/repos/github/gh-aw/actions/workflows/usr/bin/gh gh workflow list --json name,state,path bose(http block)/usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 100(http block)/usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 6 all("session") a-C(http block)https://api.github.com/repos/github/gh-aw/contents/.github%2Fworkflows%2Faudit-workflows.md/opt/hostedtoolcache/node/24.14.0/x64/bin/node /opt/hostedtoolcache/node/24.14.0/x64/bin/node --experimental-import-meta-resolve --require /home/REDACTED/work/gh-aw/gh-aw/actions/setup/js/node_modules/vitest/suppress-warnings.cjs --conditions node --conditions development /home/REDACTED/work/gh-aw/gh-aw/actions/setup/js/node_modules/vitest/dist/workers/forks.js . 0/x64/lib/node_mgit add . forks.js rev-�� --reverse origin/fallback-branch..HEAD 86_64/git -m Initial commit it /usr/lib/git-cordfc87c6480180a5afc5d79c54379a5d1046c2567..HEAD(http block)https://api.github.com/repos/github/gh-aw/git/ref/tags/v0.47.4/usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v0.47.4 --jq .object.sha --show-toplevel 64/pkg/tool/linux_amd64/vet /usr/bin/git --noprofile .cfg 64/pkg/tool/linu--show-toplevel git rev-�� --show-toplevel 64/pkg/tool/linux_amd64/vet /usr/bin/git rity301436861/00git(http block)https://api.github.com/repos/github/gh-aw/git/ref/tags/v1.0.0/usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha ty-test.md .cfg 64/pkg/tool/linux_amd64/vet(http block)https://api.github.com/repos/github/gh-aw/git/ref/tags/v1.2.3/usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.2.3 --jq .object.sha th .prettierigno-errorsas --local _modules/.bin/no-nilfunc credential.helpe/opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/compile(http block)https://api.github.com/repos/github/gh-aw/git/ref/tags/v2.0.0/usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq .object.sha th .prettierigno-errorsas --local node credential.helpe/opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet(http block)/usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq .object.sha th .prettierignore --log-level=error --local ash credential.helpe/tmp/go-build3991629093/b408/envutil.test(http block)/usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq .object.sha th .prettierigno-errorsas --local ode_modules/.bin-nilfunc credential.userngit(http block)https://api.github.com/repos/github/gh-aw/git/ref/tags/v3.0.0/usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v3.0.0 --jq .object.sha th .prettierigno-errorsas --local /Microsoft.CPlat-nilfunc credential.helpe/tmp/go-build3991629093/b402/console.test(http block)https://api.github.com/repos/nonexistent/action/git/ref/tags/v999.999.999/usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha ty-test.md(http block)https://api.github.com/repos/nonexistent/repo/actions/runs/12345/usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion nore(http block)https://api.github.com/repos/owner/repo/actions/workflows/usr/bin/gh gh workflow list --json name,state,path --repo owner/repo t[bot](http block)/usr/bin/gh gh workflow list --json name,state,path --repo owner/repo nfig/composer/vendor/bin/git(http block)https://api.github.com/repos/owner/repo/contents/file.md/tmp/go-build3991629093/b396/cli.test /tmp/go-build3991629093/b396/cli.test -test.testlogfile=/tmp/go-build3991629093/b396/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true(http block)https://api.github.com/repos/test-owner/test-repo/actions/secrets/usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name(http block)invalid.example.invalid/usr/lib/git-core/git-remote-https /usr/lib/git-core/git-remote-https origin https://invalid.example.invalid/nonexistent-repo.git git add . lure test commit e_modules/.bin/git -b main _modules/.bin/gi-b git conf�� user.email test@test.com /git -b feature-branch it git(dns block)If you need me to access, download, or install something from one of these locations, you can either: