|
@@ -69,8 +69,14 @@ jobs:
|
|
|
bashbrew --version > /dev/null
|
|
bashbrew --version > /dev/null
|
|
|
diff="$(./diff-pr.sh "$GITHUB_PR_NUMBER" | tee /dev/stderr)"
|
|
diff="$(./diff-pr.sh "$GITHUB_PR_NUMBER" | tee /dev/stderr)"
|
|
|
set +x
|
|
set +x
|
|
|
- json="$(jq <<<"$diff" -Rcs '{ diff: ., length: length }')"
|
|
|
|
|
- echo "::set-output name=diff::$json"
|
|
|
|
|
|
|
+ {
|
|
|
|
|
+ diffMarker="ENDOFOIPRDIFF$RANDOM$RANDOM$RANDOM"
|
|
|
|
|
+ echo "PR_DIFF<<$diffMarker"
|
|
|
|
|
+ echo "$diff"
|
|
|
|
|
+ echo "$diffMarker"
|
|
|
|
|
+ } >> "$GITHUB_ENV"
|
|
|
|
|
+ length="$(jq <<<"$diff" -Rcs 'length')"
|
|
|
|
|
+ echo "::set-output name=length::$length"
|
|
|
- name: Comment
|
|
- name: Comment
|
|
|
uses: actions/github-script@v3
|
|
uses: actions/github-script@v3
|
|
|
with:
|
|
with:
|
|
@@ -98,8 +104,8 @@ jobs:
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
if (needNewComment) {
|
|
if (needNewComment) {
|
|
|
- const data = ${{ steps.diff.outputs.diff }};
|
|
|
|
|
- const body = "<details>\n<summary>" + commentText + "</summary>\n\n```diff\n" + data.diff + "\n```\n\n</details>";
|
|
|
|
|
|
|
+ const diff = process.env.PR_DIFF;
|
|
|
|
|
+ const body = "<details>\n<summary>" + commentText + "</summary>\n\n```diff\n" + diff + "\n```\n\n</details>";
|
|
|
await github.issues.createComment({
|
|
await github.issues.createComment({
|
|
|
owner: context.repo.owner,
|
|
owner: context.repo.owner,
|
|
|
repo: context.repo.repo,
|
|
repo: context.repo.repo,
|
|
@@ -107,4 +113,4 @@ jobs:
|
|
|
body: body,
|
|
body: body,
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
- if: fromJSON(steps.diff.outputs.diff).length > 0
|
|
|
|
|
|
|
+ if: fromJSON(steps.diff.outputs.length) > 0
|