Skip to content

Update Contributors #28

Update Contributors

Update Contributors #28

name: Update Contributors
on:
workflow_dispatch:
schedule:
- cron: "0 0 1 * *"
jobs:
update-contributors:
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v2
- name: 'Check and Update'
run: |
curl https://api.github.com/repos/$GITHUB_REPOSITORY/contributors \
| grep login \
| sed 's# "login": "##g' \
| sed 's#",##g' \
| sed 's#github-actions\[bot\]##g' \
| sed '/^[[:space:]]*$/d' \
> contributors
git config user.name 'github-actions'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git add -A
if ! git diff-index --quiet HEAD; then
echo "New Contributors available, push now"
git commit -am "Update contributors"
git push
else
echo "No new Contributors, no Push required"
fi