-
Notifications
You must be signed in to change notification settings - Fork 294
33 lines (33 loc) · 1.02 KB
/
dedupe.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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 }}