Skip to content

fix: site is now live #22

fix: site is now live

fix: site is now live #22

Workflow file for this run

name: Update README with Contributors
on:
push:
branches:
- master
jobs:
update-readme:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Get last commit author
id: get-author
run: echo "AUTHOR=$(git log -1 --pretty=format:'%an')" >> $GITHUB_ENV
- name: Get last commit author's GitHub username
id: get-username
run: echo "USERNAME=$(git log -1 --pretty=format:'%ae' | cut -d'@' -f1)" >> $GITHUB_ENV
- name: Add contributor to README
run: |
if ! grep -q "${{ env.USERNAME }}" README.md; then
echo "Adding new contributor: ${{ env.AUTHOR }}"
echo " <a href='https://github.com/${{ env.USERNAME }}'><img src='https://github.com/${{ env.USERNAME }}.png' height='50px' /></a>" >> README.md
fi
- name: Commit and push changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add README.md
git commit -m "Auto-update README with new contributor: ${{ env.AUTHOR }}" || exit 0
git push