Skip to content

Test do not merge

Test do not merge #12

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: ${{ env.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