Skip to content

new test

new test #26

name: detect secrets
on: [push, pull_request]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "detect-secrets"
detect-secrets:
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
# scan
- name: run a scan
run: |
docker run --pull=always -a stdout --rm \
-v ${{github.workspace}}:/code \
icr.io/git-defenders/detect-secrets:0.13.1.ibm.61.dss-redhat-ubi scan --update /code/.secrets.baseline
# troubleshooting
- name: audit --display-results
run: |
docker run -a stdout --rm \
-v ${{github.workspace}}:/code \
icr.io/git-defenders/detect-secrets:0.13.1.ibm.61.dss-redhat-ubi audit --display-results /code/.secrets.baseline
# troubleshooting https://github.com/iankoulski/tree
- name: tree
run: |
docker run -a stdout --rm \
-v /home/runner/work:/home/runner/work \
iankoulski/tree -a /home/runner/work
# troubleshooting
- name: all in one
run: |
docker run --pull=always -a stdout \
-v ${{github.workspace}}:/code \
--entrypoint /bin/sh \
icr.io/git-defenders/detect-secrets:0.13.1.ibm.61.dss-redhat-ubi \
-c "detect-secrets --version;
detect-secrets scan --all-files --update .secrets.baseline;
detect-secrets audit --display-results .secrets.baseline;
detect-secrets audit --report --fail-on-unaudited --fail-on-live --fail-on-audited-real .secrets.baseline"
# fail if a potential secret was found
# -v ${{ github.workspace }}:/code \
- name: fail the push if there is a potential secret that was not audited (discarded)
run: |
docker run -a stdout --rm \
-v ${{github.workspace}}:/code \
icr.io/git-defenders/detect-secrets:0.13.1.ibm.61.dss-redhat-ubi audit --report --fail-on-unaudited --fail-on-live --fail-on-audited-real .secrets.baseline