....
This commit is contained in:
@@ -77,31 +77,31 @@ jobs:
|
||||
name: 'flarectl'
|
||||
version: '0.113.0'
|
||||
|
||||
- name: Subdomain/CNAME Comparison & Creation
|
||||
- name: Grab Subdomains from Docker Compose & Cloudflare
|
||||
id: grab-subdomains
|
||||
env:
|
||||
CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
|
||||
CF_API_EMAIL: ${{ secrets.CF_API_EMAIL }}
|
||||
run: |
|
||||
flarectl dns list --zone "trez.wtf" --type=CNAME --content "trez.wtf"
|
||||
echo "Grabbing subdomains from Cloudflare..."
|
||||
flarectl --json dns list --zone "trez.wtf" --type=CNAME --content "trez.wtf" | jq '.[].Name' | sed -e 's|"||g' | awk -F"." '{print $1}' | sort > cloudflare_subdomains.txt
|
||||
echo "Grabbing subdomains from docker-compose.yml..."
|
||||
yq '.services[].labels.swag_url' docker-compose.yml | egrep -v 'null' | sed -e 's|"||g' | awk -F'.' '{print $1}' | sort > compose_subdomains.txt
|
||||
|
||||
echo "Grabbing subdomains from Cloudflare..."
|
||||
flarectl --json dns list --zone "trez.wtf" --type=CNAME --content "trez.wtf" | jq '.[].Name' | sed -e 's|"||g' | awk -F"." '{print $1}' | sort > cloudflare_subdomains.txt
|
||||
|
||||
- name: Compare Subdomains and Create Missing Ones
|
||||
id: compare-subdomains
|
||||
uses: LouisBrunner/diff-action@v2.2.0
|
||||
with:
|
||||
old: compose_subdomains.txt
|
||||
new: cloudflare_subdomains.txt
|
||||
mode: 'addition'
|
||||
mode: addition
|
||||
tolerance: mixed-better
|
||||
output: domain_compare.txt
|
||||
|
||||
- name: Create Missing Subdomains
|
||||
if: steps.compare-subdomains.outputs.output != ''
|
||||
run: |
|
||||
echo ${{ steps.compare-subdomains.outputs.output }}
|
||||
# - name: Create Missing Subdomains
|
||||
# if: steps.compare-subdomains.outputs.output != ''
|
||||
# run: |
|
||||
# cat ${{ steps.compare-subdomains.outputs.output }}
|
||||
|
||||
# merge-pr:
|
||||
# name: PR Merge
|
||||
|
||||
Reference in New Issue
Block a user