Skip to content

Removing hardcoded options in GHA docker run and providing output configuration #4068

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

kellydunn
Copy link

@kellydunn kellydunn commented Apr 18, 2025

Description:

When using the trufflesecurity/trufflehog Github Action, there's currently no way to configure --fail, in the Github action itself, as it is hardcoded in action.yml here.

Additionally, it's helpful to be able to take the very useful output of trufflehog and process it in our own actions so we can aggregate the data to our observability tools. To enable this, this PR also provides an output block that enables developers to reference Trufflehog output in their actions via ${{ steps.trufflehog.outputs.results }}

This way, developers can run the github action like so:

      - name: Run Trufflehog
        id: trufflehog
        uses: trufflesecurity/trufflehog@main
        with:
          base: <base>
          head: <head>
          no_fail: "true"
          extra_args: "--json --results=verified,unknown"
          
      - name: Use Output
        id: use-output
        run: |
          echo ${{ steps.trufflehog.outputs.results }} | jq -s | ./bin/script

Update: This PR now also includes a more explicit mounting of ${{ github.workspace }} to the docker container, as before the relative path being mounted to /tmp wouldn't pick up any changes when providing commit ranges to the scan.

Checklist:

  • Tests passing (make test-community)?
  • Lint passing (make lint this requires golangci-lint)?

@kellydunn kellydunn requested a review from a team as a code owner April 18, 2025 01:20
@CLAassistant
Copy link

CLAassistant commented Apr 18, 2025

CLA assistant check
All committers have signed the CLA.

@kashifkhan0771
Copy link
Contributor

Hi @kellydunn Thanks for submitting the PR. Can you please sign the CLA.

…figuration

outputting results

outputting results

outputting results

outputting results

outputting results

outputting results

outputting results

Attempting to mount github workspace for commit scans

Adding back in hardcoded options, but electing to use GHA vars

Adding in explicit no_fail input and check

Removing conditional break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants