PR Code Scan #15
This file contains hidden or 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: PR Code Scan | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| branches: | |
| - master | |
| - main | |
| - test | |
| workflow_dispatch: | |
| jobs: | |
| scan_pr_code: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Step 1: Checkout the repository code | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| # Step 2: Download the Checkmarx AST CLI tar.gz | |
| - name: Download AST CLI | |
| run: | | |
| curl -L -o ast-cli_linux_x64.tar.gz https://github.com/Checkmarx/ast-cli/releases/download/2.3.22/ast-cli_linux_x64.tar.gz | |
| # Step 3: Extract the tar.gz file and inspect contents | |
| - name: Extract AST CLI | |
| run: | | |
| tar -xzf ast-cli_linux_x64.tar.gz | |
| echo "Extracted files:" | |
| ls -l | |
| chmod +x ./ast-cli | |
| # Step 4: Make your scan script executable | |
| - name: Make Script Executable | |
| run: chmod +x git-secret-scanner.sh | |
| # Step 5: Run the Scan Script | |
| - name: Run Scan Script | |
| run: bash ./git-secret-scanner.sh "https://github.com/hirendgithub/ADO-Project.git" "${{ github.head_ref || github.ref_name }}" | |
| # Step 6: Report the results | |
| - name: Report Scan Results | |
| run: | | |
| echo "Pull Request code scan completed. Check workflow logs for details." |