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

file option not working #389

Open
devinrsmith opened this issue Dec 13, 2022 · 7 comments
Open

file option not working #389

devinrsmith opened this issue Dec 13, 2022 · 7 comments
Labels
bug Something isn't working

Comments

@devinrsmith
Copy link

I've got an action defined:

      - name: Create SBOMs
        uses: anchore/sbom-action@v0
        with:
          file: ./server/jetty-app/build/distributions/server-jetty-0.20.0.tar
          upload-release-assets: false

Unfortunately, it looks like it's running with path instead of file.

2022-12-13T20:56:09.6180813Z ##[group]Run anchore/sbom-action@v0
2022-12-13T20:56:09.6181622Z with:
2022-12-13T20:56:09.6182429Z   file: ./server/jetty-app/build/distributions/server-jetty-0.20.0.tar
2022-12-13T20:56:09.6183453Z   upload-release-assets: false
2022-12-13T20:56:09.6184185Z   path: .
2022-12-13T20:56:09.6184877Z   format: spdx-json
2022-12-13T20:56:09.6185775Z   github-token: ***
2022-12-13T20:56:09.6186510Z   dependency-snapshot: false
2022-12-13T20:56:09.6187251Z   upload-artifact: true
2022-12-13T20:56:09.6187965Z env:
2022-12-13T20:56:09.6188746Z   JAVA_HOME: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/11.0.17-8/x64
2022-12-13T20:56:09.6189666Z   JAVA_HOME_11_X64: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/11.0.17-8/x64
2022-12-13T20:56:09.6190582Z   JAVA_HOME_17_X64: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.5-8/x64
2022-12-13T20:56:09.6191378Z ##[endgroup]
...
2022-12-13T20:56:13.5970942Z ␛[0;90m[0000]␛[0m ␛[0;34mDEBUG␛[0m indexing filesystem path="."
...

Related to #385?

@kzantow
Copy link
Contributor

kzantow commented Dec 13, 2022

Is there something to indicate the scan itself is using path instead of file? The path default is ., which means it will always get that path value by default...

@devinrsmith
Copy link
Author

I'm new to the SBOM / syft scene, so maybe my expectations are wrong, but I expected the SBOM to only be related to the file I specified, somewhat analogous to if I had run

syft file:./server/jetty-app/build/distributions/server-jetty-0.20.0.tar

but everything in my working directory is being scanned. I can add the full action logs, or the resulting SBOM, if it would be helpful.

@devinrsmith
Copy link
Author

indexing filesystem path="."

@kzantow
Copy link
Contributor

kzantow commented Jan 5, 2023

Could you extract the tar in a prior step and then run the scan-action on the directory?

@felddy
Copy link

felddy commented Apr 3, 2023

FWIW, I'm seeing this same behavior.

GitHub Actions run:

Calling step:

      - name: Generate SBOM
        uses: anchore/sbom-action@422cb34a0f8b599678c41b21163ea6088edb2624
        with:
          artifact-name: ${{ steps.clean.outputs.image_archive_name_stem }}-sbom.spdx.json
          file: ${{ steps.clean.outputs.image_archive_name_stem }}.tar
          upload-artifact-retention: ${{ inputs.artifact_retention_days }}

@spiffcs spiffcs added the bug Something isn't working label May 18, 2023
@spiffcs
Copy link
Contributor

spiffcs commented May 18, 2023

It looks like file and path should be mutually exclusive here (one clobbering the other if provided). I added the bug label to this and put it into our backlog to take a look at when we have some team cycles.

If anyone on this issue has already investigated and knows the specific fix I am happy to take a look at the PR for review and help approve / work to make it into main =)

@dn0
Copy link

dn0 commented Jul 24, 2023

This is seems to be a problem with the defaults and input parsing. This helps:

with:
  path: null
  file: ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Backlog
Development

No branches or pull requests

5 participants