Skip to content

Commit 6d7d773

Browse files
Merge pull request #21 from harmoniqs/copilot/add-pr-comment-summary-dry-run
Post dry-run PR comment only when TASKS.md changes, edit in place
2 parents ba47064 + e045b0b commit 6d7d773

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

action.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,13 @@ runs:
112112
exit 0
113113
fi
114114
115+
# Only comment when the tasks file was changed in this PR
116+
if ! gh pr diff "${{ github.event.pull_request.number }}" --name-only \
117+
| grep -qxF "${{ inputs.tasks-file }}"; then
118+
echo "Tasks file not changed in this PR; skipping comment."
119+
exit 0
120+
fi
121+
115122
CREATED=$(python3 -c "import json; print(json.load(open('/tmp/tasksmd-sync-result.json'))['created'])")
116123
UPDATED=$(python3 -c "import json; print(json.load(open('/tmp/tasksmd-sync-result.json'))['updated'])")
117124
ARCHIVED=$(python3 -c "import json; print(json.load(open('/tmp/tasksmd-sync-result.json'))['archived'])")
@@ -128,4 +135,5 @@ runs:
128135
129136
> This is a preview. Changes will be applied when merged to main."
130137
131-
gh pr comment "${{ github.event.pull_request.number }}" --body "$BODY"
138+
gh pr comment "${{ github.event.pull_request.number }}" \
139+
--body "$BODY" --edit-last --create-if-none

0 commit comments

Comments
 (0)