Skip to content

Revert mockk=

Revert mockk= #14

Workflow file for this run

name: Test init matrix
on:
push:
branches: ["*"]
paths:
- init/**
- .github/workflows/init-matrix.yml
pull_request:
branches: ["*"]
paths:
- init/**
- .github/workflows/init-matrix.yml
workflow_dispatch:
inputs:
url:
description: "Single url to scan or scan all urls"
required: false
default: ""
jobs:
tests1:
runs-on: ubuntu-latest
name: Prepare full scan
outputs:
urls: ${{ steps.init.outputs.urls }}
sites: ${{ steps.init.outputs.sites }}
config: ${{ steps.init.outputs.config }}
steps:
- name: Checkout repository
uses: actions/checkout@v5
- shell: bash
run: |
cd init
- id: init
uses: ./init
- id: test
shell: bash
run: |
EXPECTED="[{"url":"https://www.free.fr","title":"Free","repositories":["iliad/free-ui","iliad/free-api"],"tools":{"404":true,"budget_page":true,"codescan":true,"declaration-a11y":true,"declaration-rgpd":true,"dependabot":true,"dsfr":true,"ecoindex":true,"http":true,"lighthouse":true,"nmap":true,"nuclei":false,"screenshot":true,"stats":true,"testssl":false,"thirdparties":true,"updownio":true,"wappalyzer":true,"zap":true},"subpages":["https://www.free.fr"]},{"url":"http://chez.com","repositories":["chez/chez-ui","chez/chez-api"],"pages":["/login","/profile"],"tools":{"404":true,"budget_page":true,"codescan":true,"declaration-a11y":true,"declaration-rgpd":true,"dependabot":true,"dsfr":true,"ecoindex":true,"http":true,"lighthouse":true,"nmap":true,"nuclei":false,"screenshot":false,"stats":false,"testssl":true,"thirdparties":true,"updownio":false,"wappalyzer":true,"zap":true},"subpages":["http://chez.com","http://chez.com/login","http://chez.com/profile"]},{"url":"https://voila.fr","tools":{"404":true,"budget_page":true,"codescan":true,"declaration-a11y":true,"declaration-rgpd":true,"dependabot":true,"dsfr":true,"ecoindex":true,"http":true,"lighthouse":true,"nmap":true,"nuclei":false,"screenshot":true,"stats":true,"testssl":false,"thirdparties":true,"updownio":true,"wappalyzer":true,"zap":true},"subpages":["https://voila.fr"]}]"
RESULT="${{ steps.init.outputs.sites }}"
echo "RESULT=$RESULT"
[[ "$EXPECTED" == "$RESULT" ]]
scans1:
runs-on: ubuntu-latest
name: Scan
needs: tests1
continue-on-error: true
strategy:
fail-fast: false
max-parallel: 3
matrix:
sites: ${{ fromJson(needs.tests1.outputs.sites) }}
steps:
- shell: bash
run: |
echo "${{ matrix.sites.url }}"
echo "${{ join(matrix.sites.repositories) }}"
tests2:
runs-on: ubuntu-latest
name: Prepare scan with url input
outputs:
urls: ${{ steps.init.outputs.urls }}
sites: ${{ steps.init.outputs.sites }}
config: ${{ steps.init.outputs.config }}
steps:
- name: Checkout repository
uses: actions/checkout@v5
- shell: bash
run: |
cd init
- id: init
uses: ./init
with:
# fake manual url input
url: "https://www.free.fr,https://voila.fr"
- shell: bash
id: test
run: |
EXPECTED="[{"url":"https://www.free.fr","title":"Free","repositories":["iliad/free-ui","iliad/free-api"],"tools":{"404":true,"budget_page":true,"codescan":true,"declaration-a11y":true,"declaration-rgpd":true,"dependabot":true,"dsfr":true,"ecoindex":true,"http":true,"lighthouse":true,"nmap":true,"nuclei":false,"screenshot":true,"stats":true,"testssl":false,"thirdparties":true,"updownio":true,"wappalyzer":true,"zap":true},"subpages":["https://www.free.fr"]},{"url":"http://chez.com","repositories":["chez/chez-ui","chez/chez-api"],"pages":["/login","/profile"],"tools":{"404":true,"budget_page":true,"codescan":true,"declaration-a11y":true,"declaration-rgpd":true,"dependabot":true,"dsfr":true,"ecoindex":true,"http":true,"lighthouse":true,"nmap":true,"nuclei":false,"screenshot":false,"stats":false,"testssl":true,"thirdparties":true,"updownio":false,"wappalyzer":true,"zap":true},"subpages":["http://chez.com","http://chez.com/login","http://chez.com/profile"]},{"url":"https://voila.fr","tools":{"404":true,"budget_page":true,"codescan":true,"declaration-a11y":true,"declaration-rgpd":true,"dependabot":true,"dsfr":true,"ecoindex":true,"http":true,"lighthouse":true,"nmap":true,"nuclei":false,"screenshot":true,"stats":true,"testssl":false,"thirdparties":true,"updownio":true,"wappalyzer":true,"zap":true},"subpages":["https://voila.fr"]}]"
RESULT="${{ steps.init.outputs.sites }}"
echo "RESULT=$RESULT"
[[ "$EXPECTED" == "$RESULT" ]]
scans2:
runs-on: ubuntu-latest
name: Scan
needs: tests2
continue-on-error: true
strategy:
fail-fast: false
max-parallel: 3
matrix:
sites: ${{ fromJson(needs.tests2.outputs.sites) }}
steps:
- shell: bash
run: |
echo "${{ matrix.sites.url }}"
echo "${{ join(matrix.sites.repositories) }}"
- shell: bash
if: ${{ matrix.sites.repositories }}
run: |
echo "for ${{ matrix.sites.url }}"
echo "if ${{ join(matrix.sites.repositories) }}"