feat: updown-init action (#297) #1216
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
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: "" | |
name: Test init matrix | |
jobs: | |
test1: | |
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: | |
- uses: actions/checkout@v3 | |
- run: | | |
cd init | |
- id: init | |
uses: "./init" | |
- id: test | |
run: | | |
EXPECTED="[{url:https://www.free.fr,title:Free,repositories:[iliad/free-ui,iliad/free-api],tools:{screenshot:true,nmap:true,zap:true,wappalyzer:true,http:true,testssl:true,lighthouse:true,thirdparties:true,nuclei:true,updownio:true,dependabot:true,codescan:true,stats:true,budget_page:true,declaration-a11y:true,declaration-rgpd:true,betagouv:true},subpages:[https://www.free.fr]},{url:http://chez.com,repositories:[chez/chez-ui,chez/chez-api],pages:[/login,/profile],tools:{screenshot:false,nmap:true,zap:true,wappalyzer:true,http:true,testssl:true,lighthouse:true,thirdparties:true,nuclei:true,updownio:false,dependabot:true,codescan:true,stats:false,budget_page:true,declaration-a11y:true,declaration-rgpd:true,betagouv:true},subpages:[http://chez.com,http://chez.com/login,http://chez.com/profile]},{url:https://voila.fr,tools:{screenshot:true,nmap:true,zap:true,wappalyzer:true,http:true,testssl:true,lighthouse:true,thirdparties:true,nuclei:true,updownio:true,dependabot:true,codescan:true,stats:true,budget_page:true,declaration-a11y:true,declaration-rgpd:true,betagouv:true},subpages:[https://voila.fr]}]" | |
RESULT="${{ steps.init.outputs.sites }}" | |
echo "RESULT=$RESULT" | |
[[ "$EXPECTED" == "$RESULT" ]] | |
scans: | |
runs-on: ubuntu-latest | |
name: Scan | |
needs: test1 | |
continue-on-error: true | |
strategy: | |
fail-fast: false | |
max-parallel: 3 | |
matrix: | |
sites: ${{ fromJson(needs.test1.outputs.sites) }} | |
steps: | |
- uses: actions/checkout@v3 | |
- run: | | |
echo "${{ matrix.sites.url }}" | |
echo "${{ join(matrix.sites.repositories) }}" | |
test2: | |
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: | |
- uses: actions/checkout@v3 | |
- run: | | |
cd init | |
- id: init | |
uses: "./init" | |
with: | |
# fake manual url input | |
url: "https://www.free.fr,https://voila.fr" | |
- id: test | |
run: | | |
EXPECTED="[{url:https://www.free.fr,title:Free,repositories:[iliad/free-ui,iliad/free-api],tools:{screenshot:true,nmap:true,zap:true,wappalyzer:true,http:true,testssl:true,lighthouse:true,thirdparties:true,nuclei:true,updownio:true,dependabot:true,codescan:true,stats:true,budget_page:true,declaration-a11y:true,declaration-rgpd:true,betagouv:true},subpages:[https://www.free.fr]},{url:https://voila.fr,tools:{screenshot:true,nmap:true,zap:true,wappalyzer:true,http:true,testssl:true,lighthouse:true,thirdparties:true,nuclei:true,updownio:true,dependabot:true,codescan:true,stats:true,budget_page:true,declaration-a11y:true,declaration-rgpd:true,betagouv:true},subpages:[https://voila.fr]}]" | |
RESULT="${{ steps.init.outputs.sites }}" | |
echo "RESULT=$RESULT" | |
[[ "$EXPECTED" == "$RESULT" ]] | |
scans2: | |
runs-on: ubuntu-latest | |
name: Scan | |
needs: test2 | |
continue-on-error: true | |
strategy: | |
fail-fast: false | |
max-parallel: 3 | |
matrix: | |
sites: ${{ fromJson(needs.test2.outputs.sites) }} | |
steps: | |
- uses: actions/checkout@v3 | |
- run: | | |
echo "${{ matrix.sites.url }}" | |
echo "${{ join(matrix.sites.repositories) }}" | |
- if: ${{ matrix.sites.repositories }} | |
run: | | |
echo "for ${{ matrix.sites.url }}" | |
echo "if ${{ join(matrix.sites.repositories) }}" |