-
Notifications
You must be signed in to change notification settings - Fork 377
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GitHub Action: 更新
update_contributors_images.yaml
, 支持签名提交
1. 替换`jaywcjlove/github-action-modify-file-content`使用 bash 重现`Modify README.md` 2. 使用`ci_commit_with_signature.sh`脚本, 通过`GraphQL Api`实现提交签名, 提交者受`api`的制约不能更改
- Loading branch information
Showing
1 changed file
with
16 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,12 +18,19 @@ jobs: | |
avatarSize: 42 | ||
|
||
- name: Modify README.md | ||
uses: jaywcjlove/[email protected] | ||
with: | ||
token: ${{ secrets.CI_GITHUB_TOKEN }} | ||
path: README.md | ||
openDelimiter: '<!--AUTO_GENERATED_PLEASE_DONT_DELETE_IT-->' | ||
closeDelimiter: '<!--AUTO_GENERATED_PLEASE_DONT_DELETE_IT-END-->' | ||
message: '修改文档: 更新`贡献者列表`' | ||
body: | | ||
${{steps.contributors.outputs.htmlList}} | ||
run: | | ||
escapedHtmlList=$(echo -e '${{steps.contributors.outputs.htmlList}}' | sed ':a;N;$!ba;s/\n/\\n/g;s/\\n$//') | ||
openDelimiter='<!--AUTO_GENERATED_PLEASE_DONT_DELETE_IT-->' | ||
closeDelimiter='<!--AUTO_GENERATED_PLEASE_DONT_DELETE_IT-END-->' | ||
sed -i "/$openDelimiter/,/$closeDelimiter/c\\$openDelimiter$escapedHtmlList$closeDelimiter" README.md | ||
git diff --quiet --exit-code README.md || echo "CHANGES_DETECTED=true" >> $GITHUB_ENV | ||
- name: Commit and push README.md | ||
if: ${{ env.CHANGES_DETECTED == 'true' }} | ||
run: | | ||
bash script/ci_commit_with_signature.sh \ | ||
${{ secrets.CI_GITHUB_TOKEN }} \ | ||
"maboloshi/github-chinese" \ | ||
"README.md" \ | ||
"修改文档: 更新\`贡献者列表\`" \ | ||
"Signed-off-by: 沙漠之子 <[email protected]>" |