diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 71bf1aa..68d4d34 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,20 +1,48 @@ -name: Build & Test API - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Use Node.js - uses: actions/setup-node@v3 - with: - node-version: 18 - - run: npm ci - - run: npm test \ No newline at end of file +name: Build & Test API + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +permissions: + contents: read + actions: write + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Setup InvisiRisk - Build Application Firewall + uses: invisirisk/pse-action@latest + with: + api_url: "https://app.invisirisk.com" + app_token: ${{ secrets.IR_API_KEY }} + + - uses: actions/checkout@v3 + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: 18 + - run: npm ci + - run: npm test + + - name: Cleanup Build Application Firewall + if: always() + uses: invisirisk/pse-action@latest + with: + cleanup: "true" + + gather_analytics: + runs-on: ubuntu-latest + name: Gather Analytics + needs: [build] + steps: + - name: Gather Status + uses: invisirisk/pse-action@latest + with: + api_url: "https://app.invisirisk.com" + app_token: ${{ secrets.IR_API_KEY }} + send_job_status: "true"