Skip to content

Added security workflows #2

Added security workflows

Added security workflows #2

Workflow file for this run

name: Detect Secrets Scan
on:
workflow_dispatch:
pull_request:
env:
exclude: ''
permissions:
contents: read
pull-requests: write
jobs:
detect-secrets:
name: Detect Secrets Scan
runs-on: ubuntu-latest
container:
image: python:latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Change Owner of Container Working Directory
run: chown root:root .
- name: Install detect-secrets
run: pip install detect-secrets
- name: Set --exclude-files arguments
if: $exclude != ''

Check failure on line 27 in .github/workflows/detect-secrets.yml

View workflow run for this annotation

GitHub Actions / Detect Secrets Scan

Invalid workflow file

The workflow is not valid. .github/workflows/detect-secrets.yml (Line: 27, Col: 13): Unexpected symbol: '$exclude'. Located at position 1 within expression: $exclude != ''
shell: bash
run: |
# Use a loop to parse the values in the exclude input and build the desired string
exclude_args=""
IFS=' ' read -a arr <<< $exclude
for ex in "${arr[@]}"
do
exclude_args="${exclude_args} --exclude-files '${ex}'"
done
echo "exclude_args=${exclude_args}" >> $GITHUB_ENV
- name: Run detect-secrets-hook
shell: bash
run: |
detect-secrets-hook --baseline .secrets.baseline ${{ env.exclude_args }} * --json > /tmp/secrets.json
- name: Show detect-secrets differences
if: ${{ failure() }}
run: git diff