feat: create github action to wait for discovery to finish #1
Workflow file for this run
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
name: CI / Automated testing | |
on: | |
pull_request: | |
branches: | |
- '**' | |
jobs: | |
build: | |
name: Build GitHub Action | |
runs-on: ubuntu-latest | |
container: node:20 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: npm ci && npm install -g @vercel/ncc | |
- name: Build release | |
run: npm run lint && npm run build && npm run pack | |
- name: Copy files to release | |
run: | | |
mkdir release | |
cp README.md release/ | |
cp action.yml release/ | |
cp -R dist/ release/dist/ | |
- name: Start Bright Scan 🏁 | |
id: scan | |
uses: NeuraLegion/run-discovery@release | |
with: | |
api_token: ${{ secrets.BRIGHTSEC_TOKEN }} | |
name: GitHub discovery ${{ github.sha }} | |
project_id: ${{ vars.PROJECT_ID }} | |
hostname: ${{ vars.HOSTNAME }} | |
discovery_types: | | |
[ "crawler" ] | |
crawler_urls: | | |
[ "https://security-crawl-maze.app/html/" ] | |
hosts_filter: | | |
[ ] | |
- name: Wait for discovery to finish ⏳ | |
id: wait | |
uses: ./release | |
continue-on-error: true | |
with: | |
api_token: ${{ secrets.BRIGHTSEC_TOKEN }} | |
discovery_id: ${{ steps.scan.outputs.id }} | |
project_id: ${{ vars.PROJECT_ID }} | |
timeout: 300 # in general cases we'll have a timeout and it is good for this test | |