merge(#3): chore: further optimizations to workflow #3
This file contains hidden or 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 AUTHORS.md on merge | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: yarn install | |
- name: Run authors | |
run: yarn authors | |
- name: Check if AUTHORS.md has changed | |
run: | | |
if git status --porcelain | grep 'AUTHORS.md'; then | |
echo "CHANGED=true" >> $GITHUB_ENV | |
else | |
echo "CHANGED=false" >> $GITHUB_ENV | |
fi | |
echo "CHANGED is $CHANGED" | |
- name: Commit changes | |
if: ${{ env.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 AUTHORS.md | |
git commit -m "docs: update AUTHORS.md" | |
git push |