Skip to content

Update contributors images in README.md #7

Update contributors images in README.md

Update contributors images in README.md #7

name: Update contributors images in README.md
on:
workflow_dispatch:
jobs:
build-deploy:
runs-on: ubuntu-latest
environment: github-pages
steps:
- name: Generate a token
id: generate_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Checkout repository
uses: actions/checkout@v4
- name: Generate Contributors Images
uses: jaywcjlove/[email protected]
id: contributors
with:
filter-author: (action-assistant\[bot\]|renovate\[bot\]|renovate-bot|@github-actions-bot|dependabot\[bot\]|ImgBotApp|imgbot\[bot\])
avatarSize: 42
- name: Modify README.md
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' }}
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
APP_SLUG: ${{ steps.generate_token.outputs.app-slug }}
run: |
bash script/ci_commit_with_signature.sh \
-R "${{ github.repository }}" \
-B "${{ github.ref_name }}" \
-P "${{ github.sha }}" \
-F "README.md" \
-h "修改文档: 更新\`贡献者列表\`"