From f8d6564069c59de6da3e7319b59313ba2f70681a Mon Sep 17 00:00:00 2001 From: Tim Harder Date: Tue, 12 Nov 2024 04:11:53 -0700 Subject: [PATCH] use diff format for PR comments --- pkgcruft-action | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkgcruft-action b/pkgcruft-action index 4ecb551..c21aa42 100755 --- a/pkgcruft-action +++ b/pkgcruft-action @@ -65,7 +65,13 @@ set +e echo -e "\n\nNo differences from target branch: ${GIT_BASE_BRANCH}" >> "${diff_output}" fi cat "${diff_output}" - gh pr comment ${GH_PR} -F "${diff_output}" + + # use diff format for PR comments + pr=$(mktemp) + echo '```diff' >> "${pr}" + cat "${diff_output}" >> "${pr}" + echo '```' >> "${pr}" + gh pr comment ${GH_PR} -F "${pr}" fi elif [[ ${GIT_BRANCH} != ${GIT_DEFAULT_BRANCH} ]]; then # default branch to non-default branch diff