Skip to content

test: improve code coverage for client package #3

test: improve code coverage for client package

test: improve code coverage for client package #3

Workflow file for this run

name: Update Contributors (Git-based)
on:
push:
branches:
- main
pull_request:
types: [closed]
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
update-contributors:
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.event.pull_request.merged == true)
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate Contributors List
run: |
echo "# Contributors" > CONTRIBUTORS.md
echo "" >> CONTRIBUTORS.md
echo "Thank you to all our contributors! This file is automatically generated from git history." >> CONTRIBUTORS.md
echo "" >> CONTRIBUTORS.md
# Get all contributors sorted by number of commits
echo "## Contributors by Commits" >> CONTRIBUTORS.md
echo "" >> CONTRIBUTORS.md
git log --format='%aN' | sort | uniq -c | sort -rn | while read count name; do
echo "- **$name** - $count commits" >> CONTRIBUTORS.md
done
echo "" >> CONTRIBUTORS.md
echo "## All Contributors (Alphabetical)" >> CONTRIBUTORS.md
echo "" >> CONTRIBUTORS.md
# Get unique contributors alphabetically
git log --format='%aN' | sort -u | while read name; do
echo "- $name" >> CONTRIBUTORS.md
done
echo "" >> CONTRIBUTORS.md
echo "---" >> CONTRIBUTORS.md
echo "_Last updated: $(date -u +"%Y-%m-%d %H:%M:%S UTC")_" >> CONTRIBUTORS.md
- name: Check for changes
id: check_changes
run: |
if git diff --quiet CONTRIBUTORS.md; then
echo "changed=false" >> $GITHUB_OUTPUT
else
echo "changed=true" >> $GITHUB_OUTPUT
fi
- name: Commit changes
if: steps.check_changes.outputs.changed == 'true'
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add CONTRIBUTORS.md
git commit -m "docs: update CONTRIBUTORS.md [skip ci]"
- name: Push changes
if: steps.check_changes.outputs.changed == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}