Skip to content

Commit 8332631

Browse files
committed
limit marker to github bot.
1 parent 768a9c4 commit 8332631

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

.github/workflows/coverage_comment.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,16 @@ jobs:
4848
exit 1
4949
fi
5050
51+
# Only match comments authored by the GITHUB_TOKEN bot, so a human
52+
# comment that happens to start with the marker doesn't get
53+
# silently overwritten.
5154
EXISTING=$(gh api "repos/${REPO}/issues/${PR_NUMBER}/comments" --paginate \
52-
--jq 'first(.[] | select(.body | startswith("<!-- coverage-report -->")) | .id) // empty')
55+
--jq 'first(
56+
.[]
57+
| select(.user.login == "github-actions[bot]"
58+
and (.body | startswith("<!-- coverage-report -->")))
59+
| .id
60+
) // empty')
5361
5462
# Body comes from the untrusted upstream run; pass via --rawfile +
5563
# --input - so it's never shell-interpolated.

0 commit comments

Comments
 (0)