Update mail_domains.txt #18
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: Verify MX Servers | |
on: | |
# Triggers the workflow on push or pull request events but only for the "main" branch | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
netcat25: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Run a multi-line script | |
run: | | |
newlist=$(mktemp) | |
faillist=$(mktemp) | |
for _name in $(<mx_servers.txt);do | |
echo "Checking ${_name}" | |
(echo | nc -z ${_name} 25 2>/dev/null) && ( echo ${_name} >> ${newlist} ) || ( echo ${_name} >> ${faillist} ) | |
done | |
sort -u ${newlist} > mx_servers.txt | |
REMOVED=$(sort -u ${faillist}|tr '\n' ' ') | |
echo "REMOVED=${REMOVED}">>$GITHUB_ENV | |
- name: Create commits | |
run: | | |
git config user.name 'Pantelis Roditis' | |
git config user.email 'proditis@users.noreply.github.com' | |
[[ -z $(git status -s) ]] || git commit -am "Modify tracked file during workflow" | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
body: "Removed the following domains: ${{ env.REMOVED }}" |