Skip to content

Commit

Permalink
GitHub Action: 更新update_contributors_images.yaml, 支持签名提交
Browse files Browse the repository at this point in the history
1. 替换`jaywcjlove/github-action-modify-file-content`使用 bash 重现`Modify README.md`
2. 使用`ci_commit_with_signature.sh`脚本, 通过`GraphQL Api`实现提交签名, 提交者受`api`的制约不能更改
  • Loading branch information
maboloshi committed Nov 26, 2023
1 parent 6b0d7d1 commit ecb45c9
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions .github/workflows/update_contributors_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]>"

0 comments on commit ecb45c9

Please sign in to comment.