Updated catche step, flarectl install, and subdomain extraction.

This commit is contained in:
2025-01-03 10:15:08 -05:00
parent 5dbeb89996
commit 78400eec08
+6 -19
View File
@@ -46,8 +46,6 @@ jobs:
path: |
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Setup yq
uses: dcarbone/install-yq-action@v1
@@ -61,29 +59,18 @@ jobs:
- name: Setup jq
uses: dcarbone/install-jq-action@v3.0.1
- name: Retrieve Subdomains from Cloudflare
- name: Install flarectl
if: steps.cache-flarectl.outputs.cache-hit != 'true'
run: |
go install github.com/cloudflare/cloudflare-go/cmd/flarectl@latest
- name: Retrieve Subdomains from Cloudflare & Compose
id: retrieve-cloudflare-subdomains
env:
CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
CF_API_EMAIL: ${{ secrets.CF_API_EMAIL }}
run: |
go env
# Check if flarectl exists; install if not cached
if ! command -v flarectl &> /dev/null; then
echo "flarectl not found, installing..."
go env ${{ github.workspace }}
go install github.com/cloudflare/cloudflare-go/cmd/flarectl@latest
else
echo "flarectl found in cache."
fi
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: Grab subdomains from Compose
id: compose-domains
env:
CF_API_KEY: ${{ secrets.CF_API_TOKEN }}
CF_API_EMAIL: ${{ secrets.CF_API_EMAIL }}
run: |
yq '.services[].labels.swag_url' docker-compose.yml | egrep -v 'null' | sed -e 's|"||g' | awk -F'.' '{print $1}' | sort > compose_subdomains.txt
- name: Compare Subdomains