Merge pull request #453 from jede/master #165
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: Dedupe and Sort Domains | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
permissions: write-all | |
jobs: | |
dedupe: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
ref: ${{github.event.pull_request.head.ref}} | |
repository: ${{github.event.pull_request.head.repo.full_name}} | |
- name: Check for duplicates and sort alphabetically | |
run: grep -v '^$' emails.txt | sort -uo emails.txt | |
- name: Commit Changes | |
run: | | |
git add emails.txt | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
# commit only if any changes | |
if [ ! -z "$(git status --porcelain)" ]; then | |
git commit -m "[chore]: Sort and dedupe \`emails.txt\`" | |
git push | |
fi | |
# - name: Push changes | |
# uses: ad-m/github-push-action@master | |
# with: | |
# github_token: ${{ secrets.GITHUB_TOKEN }} | |
# branch: ${{ github.ref }} |