From 05b783869f241719e47ef556b6a0885086243ddb Mon Sep 17 00:00:00 2001 From: Morgan Funtowicz Date: Fri, 14 Jun 2024 12:34:30 +0200 Subject: [PATCH] feat(security): add secrets scanning workflow --- .github/workflows/security.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/security.yml diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml new file mode 100644 index 000000000..f2682f98e --- /dev/null +++ b/.github/workflows/security.yml @@ -0,0 +1,29 @@ +name: Security Checks + +on: + push: + +permissions: + contents: read + +jobs: + secrets: + runs-on: ubuntu-latest + steps: + - shell: bash + run: | + if [ "${{ github.event_name }}" == "push" ]; then + echo "depth=$(($(jq length <<< '${{ toJson(github.event.commits) }}') + 2))" >> $GITHUB_ENV + echo "branch=${{ github.ref_name }}" >> $GITHUB_ENV + fi + if [ "${{ github.event_name }}" == "pull_request" ]; then + echo "depth=$((${{ github.event.pull_request.commits }}+2))" >> $GITHUB_ENV + echo "branch=${{ github.event.pull_request.head.ref }}" >> $GITHUB_ENV + fi + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: ${{env.branch}} + fetch-depth: ${{env.depth}} + - name: Scan for secrets + uses: trufflesecurity/trufflehog@main \ No newline at end of file