Skip to content
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

feat: add support for target input #10

Merged
merged 1 commit into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This action does the following:
2. Scans the built docker image for secrets with [Trufflehog](https://github.com/trufflesecurity/trufflehog).
- GitHub action fails if secrets are found in the docker image
3. Pushes the docker image to a docker repository if no secrets are found
(when push is set to `true`).
(when push is set to `true`).
4. Signs the docker image

## Usage
Expand Down Expand Up @@ -39,6 +39,7 @@ This GitHub Action only accepts the following inputs.
- `sbom`
- `secret-envs`
- `tags`
- `target`

If you want to use an input which is not in the above mentioned list,
feel free to contribute or reach out to infra team for support.
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ inputs:
tags:
description: "List of tags"
required: false
target:
description: "Set the target build stage to build"
required: false

outputs:
imageid:
Expand Down Expand Up @@ -75,6 +78,7 @@ runs:
secret-envs: ${{ inputs.secret-envs }}
cache-from: ${{ inputs.cache-from }}
cache-to: ${{ inputs.cache-to }}
target: ${{ inputs.target }}
outputs: type=docker,dest=${{ runner.temp }}/local-docker-image.tar

- name: Scan docker image with TruffleHog
Expand Down Expand Up @@ -105,6 +109,7 @@ runs:
secret-envs: ${{ inputs.secret-envs }}
cache-from: ${{ inputs.cache-from }}
cache-to: ${{ inputs.cache-to }}
target: ${{ inputs.target }}

- name: Sign the images with GitHub OIDC Token
env:
Expand Down