Update Contributors #28
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: | |
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 |