diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..51a15685 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,48 @@ +name: CI-Polaris-Basic +on: + push: + branches: [main, master, develop, stage, release] + pull_request: + branches: [main, master, develop, stage, release] + workflow_dispatch: + + +jobs: + build: + runs-on: [ubuntu-latest] + steps: + - name: Checkout Source + uses: actions/checkout@v4 + - name: Polaris Scan + id: polaris-scan + uses: blackduck-inc/black-duck-security-scan@v2 + with: + ### SCANNING: Required fields + polaris_server_url: ${{ vars.POLARIS_SERVER_URL }} + polaris_access_token: ${{ secrets.POLARIS_ACCESS_TOKEN }} + polaris_assessment_types: "SCA,SAST" + + ### SCANNING: Optional fields + polaris_application_name: ${{ vars.POLARIS_APPLICATION_NAME }} + polaris_project_name: ${{ vars.POLARIS_PROJECT_NAME }} + + ### PULL REQUEST COMMENTS: Uncomment below to enable + # polaris_prComment_enabled: true + # github_token: ${{ secrets.GITHUB_TOKEN }} # Required when PR comments is enabled + + ### SARIF report parameters + #polaris_reports_sarif_create: true + #polaris_upload_sarif_report: true + + ### Signature scan + #polaris_test_sca_type: "SCA-SIGNATURE" + + ### Mark build status if policy violating issues are found + # mark_build_status: 'success' + + ### Uncomment below configuration to add custom logic based on return status + # - name: cmdLine + # id: cmdLine + # run: | + # EXIT_CODE=${{ steps.polaris-scan.outputs.status }} + # echo "Polaris Scan exit status - $EXIT_CODE"