Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
remove(commands): remove dependencies flag
Browse files Browse the repository at this point in the history
Co-authored-by: Jan-Kåre Solbakken <jan-kare.solbakken@nav.no>
  • Loading branch information
ybelMekk and jksolbakken committed Mar 15, 2023
1 parent 724f43e commit 7cab5bd
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 24 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,6 @@ The Following inputs can be used as `step.with` keys
| `docker_user` | String | $GITHUB_ACTOR | User to login to container registry | False |
| `repo_name` | String | $GITHUB_REPOSITORY | The name of the repo/project | False |
| `repo_sub_dir` | String | "" | Specify a subdirectory if build file not found in working root directory | False |
| `dependencies` | Bool | true | Set to false if action should not create materials for dependencies (e.g. if build tool is unsupported or repo uses internal/private dependencies) | False |
| `build_started_on` | String | "event.(type if any).head.commit" | Specify a workflow build start time. Default is set to github_context e.g `event.head_commit` or `event.workflow_run.head_commit` depending on workflow | False |
| `mvn_opts` | String | "" | A comma-delimited string with additional maven cli options for the dependence build | False |
| `repo_dir` | String | $GITHUB_WORKSPACE | **Internal value (do not set):** Root of directory to look for build files | False |
Expand Down
8 changes: 0 additions & 8 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,6 @@ inputs:
required: false
default: "${{ github.actor }}"

dependencies:
description: |-
If salsa should generate materials for the provenance containing dependencies.
Defaults to true.
required: false
default: "true"

mvn_opts:
description: |-
A comma-delimited string with additional maven options.
Expand Down Expand Up @@ -132,7 +125,6 @@ runs:
- ${{ inputs.docker_user }}
- ${{ inputs.github_token }}
- ${{ inputs.token_key_pattern }}
- ${{ inputs.dependencies }}
- ${{ inputs.build_started_on }}
- ${{ inputs.registry_access_token }}
- ${{ inputs.registry }}
Expand Down
1 change: 0 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ scan() {
--runner-context "$RUNNER" \
--env-context "$ENVS" \
--subDir "$INPUT_REPO_SUB_DIR" \
--with-deps="$INPUT_DEPENDENCIES" \
--mvn-opts "$INPUT_MVN_OPTS" \
--build-started-on "$INPUT_BUILD_STARTED_ON" \
--remote-run
Expand Down
24 changes: 10 additions & 14 deletions pkg/commands/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ var (
)

type ProvenanceConfig struct {
WithDependencies bool
BuildStartedOn string
BuildStartedOn string
}

var scanCmd = &cobra.Command{
Expand All @@ -51,17 +50,15 @@ var scanCmd = &cobra.Command{
log.Infof("prepare to scan path %s ...", workDir)

deps := &build.ArtifactDependencies{}
if Config.WithDependencies {
generatedDeps, err := InitBuildTools(mvnOpts).DetectDeps(workDir)
if err != nil {
return fmt.Errorf("detecting dependecies: %v", err)
}

if generatedDeps != nil {
deps = generatedDeps
} else {
log.Infof("no supported build files found for directory: %s, proceeding", workDir)
}
generatedDeps, err := InitBuildTools(mvnOpts).DetectDeps(workDir)
if err != nil {
return fmt.Errorf("detecting dependecies: %v", err)
}

if generatedDeps != nil {
deps = generatedDeps
} else {
log.Infof("no supported build files found for directory: %s, proceeding", workDir)
}

contextEnvironment, err := vcs.ResolveBuildContext(&buildContext, &runnerContext, &envContext)
Expand Down Expand Up @@ -124,7 +121,6 @@ func init() {
scanCmd.Flags().StringVar(&buildContext, "build-context", "", "context of build tool")
scanCmd.Flags().StringVar(&runnerContext, "runner-context", "", "context of runner")
scanCmd.Flags().StringVar(&envContext, "env-context", "", "environmental variables of current context")
scanCmd.Flags().BoolVar(&Config.WithDependencies, "with-deps", true, "specify if the cli should generate dependencies for a provenance")
scanCmd.Flags().StringVar(&mvnOpts, "mvn-opts", "", "pass additional Comma-delimited list of options to the maven build tool")
scanCmd.Flags().StringVar(&Config.BuildStartedOn, "build-started-on", "", "set start time for the build")
}

0 comments on commit 7cab5bd

Please sign in to comment.