Skip to content

Commit

Permalink
ci: 改进提示
Browse files Browse the repository at this point in the history
  • Loading branch information
AnnAngela committed Dec 15, 2023
1 parent 3e3c3fd commit abfe123
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion scripts/infoAboutFailure.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
echo "::error title=关于代码检查失败的提示::如果代码检查失败,你可以通过以下方式查看错误原因:%0A1. 如果本次提交属于 Pull Request,你可以在该 PR 的 【Files changed】 标签页查看错误原因;%0A2. 如果本次提交属于直接推送 commit,你可以在该 commit 页查看错误原因。%0A你可能需要下拉到对应页面的最底部来查看未被修改的文件的错误原因。"
base_url="https://github.com/$GITHUB_REPOSITORY"

if [[ $GITHUB_REF == refs/pull/* ]]; then
IFS='/' read -ra parts <<< "$GITHUB_REF"
pull_number="${parts[2]}"
url="$base_url/pull/$pull_number/files"
else
url="$base_url/commit/$GITHUB_SHA"
fi

echo "::error title=关于代码检查失败的提示::您可以访问以下页面查看原因(可能需要下拉到对应页面的最底部才能找到): $url"
exit 1

0 comments on commit abfe123

Please sign in to comment.