|
| 1 | +############################################################### |
| 2 | +# Copyright (c) 2024 Contributors to the Eclipse Foundation |
| 3 | +# |
| 4 | +# See the NOTICE file(s) distributed with this work for additional |
| 5 | +# information regarding copyright ownership. |
| 6 | +# |
| 7 | +# This program and the accompanying materials are made available under the |
| 8 | +# terms of the Apache License, Version 2.0 which is available at |
| 9 | +# https://www.apache.org/licenses/LICENSE-2.0. |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, software |
| 12 | +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 13 | +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 14 | +# License for the specific language governing permissions and limitations |
| 15 | +# under the License. |
| 16 | +# |
| 17 | +# SPDX-License-Identifier: Apache-2.0 |
| 18 | +############################################################### |
| 19 | + |
| 20 | +name: "TruffleHog" |
| 21 | + |
| 22 | +on: |
| 23 | + push: |
| 24 | + branches: ["main"] |
| 25 | + pull_request: |
| 26 | + # The branches below must be a subset of the branches above |
| 27 | + branches: ["main"] |
| 28 | + schedule: |
| 29 | + - cron: "0 0 * * *" # Once a day |
| 30 | + workflow_dispatch: |
| 31 | + |
| 32 | +permissions: |
| 33 | + actions: read |
| 34 | + contents: read |
| 35 | + security-events: write |
| 36 | + id-token: write |
| 37 | + issues: write |
| 38 | + |
| 39 | +jobs: |
| 40 | + ScanSecrets: |
| 41 | + name: Scan secrets |
| 42 | + runs-on: ubuntu-latest |
| 43 | + steps: |
| 44 | + - name: Checkout Repository |
| 45 | + uses: actions/checkout@v4 |
| 46 | + with: |
| 47 | + fetch-depth: 0 # Ensure full clone for pull request workflows |
| 48 | + |
| 49 | + - name: TruffleHog OSS |
| 50 | + id: trufflehog |
| 51 | + uses: trufflesecurity/trufflehog@7e78ca385fb82c19568c7a4b341c97d57d9aa5e1 |
| 52 | + continue-on-error: true |
| 53 | + with: |
| 54 | + path: ./ # Scan the entire repository |
| 55 | + base: "${{ github.event.repository.default_branch }}" # Set base branch for comparison (pull requests) |
| 56 | + extra_args: --filter-entropy=4 --results=verified,unknown --debug --only-verified |
| 57 | + |
| 58 | + - name: Scan Results Status |
| 59 | + if: steps.trufflehog.outcome == 'failure' |
| 60 | + run: exit 1 # Set workflow run to failure if TruffleHog finds secrets |
0 commit comments