Add @YUO4YUM as a contributor #8
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
name: Update Contributors | |
on: | |
schedule: | |
- cron: '0 0 * * 1' # Runs every Monday at 00:00 UTC | |
push: | |
paths: | |
- 'README.md' | |
- '.all-contributorsrc' | |
jobs: | |
update-contributors: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Set Up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
- name: Install All Contributors CLI | |
run: npm install -g all-contributors-cli | |
- name: Add Contributors | |
run: | | |
# Extract unique GitHub usernames from commit history | |
CONTRIBUTORS=$(git log --format='%aN <%aE>' | sort -u | awk '{print $1}' | sed 's/<//;s/>//') | |
for contributor in $CONTRIBUTORS; do | |
# Add each contributor with the 'code' contribution type | |
all-contributors add $contributor code || echo "Contributor $contributor already exists." | |
done | |
- name: Generate Contributors Section | |
run: all-contributors generate | |
- name: Commit and Push Changes | |
run: | | |
git config --local user.name "GitHub Action" | |
git config --local user.email "action@github.com" | |
git add README.md .all-contributorsrc | |
git commit -m "chore: update contributors list" || echo "No changes to commit" | |
git push | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |