Files
OSINT-Framework/.github/workflows/ci.yml
T
s0lrayandPaperclip 82a9c32850 Migrate D3 v3 to v7: update arf.js, index.html, and CI
- Replace d3.layout.tree() with d3.tree()
- Replace d3.svg.diagonal() with d3.linkHorizontal() (x/y accessors swap coords)
- Replace d3.json(url, cb) with d3.json(url).then(cb)
- Replace d3.hierarchy() for root node; use .descendants() and .links()
- Strip svg: namespace prefixes from append/insert calls
- Update xlink:href to href on anchor elements
- Update data accessors to use d.data.name, d.data.url, etc.
- Fix .style("fill") call (was malformed in v3 code)
- Update event handler signature to (event, d) for D3 v7
- Use node.merge(nodeEnter) and link.merge(linkEnter) for v5+ update pattern
- Add public/js/d3.min.js (v7.9.0) copied from node_modules
- Update index.html to load d3.min.js instead of d3.v3.min.js
- Update CI smoke test to check for d3.min.js
- Keep d3.v3.min.js in place until visual parity confirmed

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-23 17:28:56 -04:00

91 lines
2.4 KiB
YAML

name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
schedule:
# Run link check weekly on Sunday at 02:00 UTC
- cron: '0 2 * * 0'
jobs:
json-lint:
name: JSON Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Validate arf.json is well-formed
run: python3 -m json.tool public/arf.json > /dev/null
smoke-test:
name: Smoke Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check index.html local asset references exist
run: |
check_asset() {
local path="public/$1"
if [ ! -f "$path" ]; then
echo "MISSING: $path"
exit 1
else
echo "OK: $path"
fi
}
check_asset "css/arf.css"
check_asset "js/d3.min.js"
check_asset "js/arf.js"
check_asset "arf.json"
link-check:
name: Link Check
runs-on: ubuntu-latest
# Only run on schedule and direct pushes to master, not on every PR
# (avoids hammering external sites during code review)
if: github.event_name == 'schedule' || (github.event_name == 'push' && github.ref == 'refs/heads/master')
steps:
- uses: actions/checkout@v4
- name: Extract URLs from arf.json
run: |
python3 -c "
import json, re, sys
with open('public/arf.json') as f:
data = json.load(f)
def extract_urls(node):
urls = []
url = node.get('url', '')
if url and url.startswith('http'):
urls.append(url)
for child in node.get('children', []):
urls.extend(extract_urls(child))
return urls
urls = extract_urls(data)
print(f'Found {len(urls)} URLs', file=sys.stderr)
with open('urls.txt', 'w') as f:
f.write('\n'.join(urls))
"
- name: Run lychee link checker
uses: lycheeverse/lychee-action@v2
with:
args: |
--verbose
--no-progress
--timeout 20
--max-retries 2
--retry-wait-time 5
--exclude-mail
--accept 200,201,204,206,301,302,307,308,403,429
urls.txt
fail: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}