Update security-checks.yml #3
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: "Security Checks Workflow" | |
on: | |
pull_request: | |
branches: [main] | |
push: | |
branches: [main] | |
permissions: | |
contents: read | |
security-events: write | |
jobs: | |
codeql-analysis: | |
name: "CodeQL Analysis" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Initialize CodeQL | |
uses: github/codeql-action/init@v3 | |
with: | |
languages: 'javascript' # Adjust languages as needed | |
- name: Perform CodeQL Analysis | |
uses: github/codeql-action/analyze@v3 | |
gitleaks-scan: | |
name: "Gitleaks Secrets Scan" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Run Gitleaks scan | |
uses: zricethezav/[email protected] | |
create-issue-on-failure: | |
if: ${{ failure() }} | |
name: "Create GitHub Issue if Security Check Fails" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Create failure log file | |
run: echo "Security check failed in one of the previous jobs. Please investigate." > failure_log.txt | |
- name: Create GitHub issue on failure | |
uses: peter-evans/create-issue-from-file@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
title: "Security Check Failure: ${{ github.workflow }}" | |
content-filepath: failure_log.txt |