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

fix: download grype on windows runners #315

Merged
merged 17 commits into from
May 23, 2024

Conversation

kzantow
Copy link
Contributor

@kzantow kzantow commented May 17, 2024

When running this action on Windows, we need to account for the .exe file suffix.

Fixes: #313

Signed-off-by: Keith Zantow <kzantow@gmail.com>
Signed-off-by: Keith Zantow <kzantow@gmail.com>
Signed-off-by: Keith Zantow <kzantow@gmail.com>
@kzantow kzantow marked this pull request as ready for review May 17, 2024 18:49
Signed-off-by: Keith Zantow <kzantow@gmail.com>
Signed-off-by: Keith Zantow <kzantow@gmail.com>
Signed-off-by: Keith Zantow <kzantow@gmail.com>
Signed-off-by: Keith Zantow <kzantow@gmail.com>
Signed-off-by: Keith Zantow <kzantow@gmail.com>
fail-build: false

- name: Validate file exists
run: ls '${{ steps.scan.outputs.sarif }}'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to double-check up the return code of ls if passed a non-existent file. On Linux, I think test -f might be a cleaner test (though test isn't available on Windows).

Not blocking though - this works.

fail-build: false

- name: Validate file exists
run: ls '${{ steps.scan.outputs.sarif }}'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just want to double-check that this way of checking whether a file exists works on Windows - don't have a windows machine in front of me to check myself.

Specifically, can you make sure that ls some-non-existent-file on Windows exits non-zero?

Signed-off-by: Keith Zantow <kzantow@gmail.com>
@kzantow kzantow closed this May 21, 2024
@kzantow kzantow reopened this May 21, 2024
Signed-off-by: Keith Zantow <kzantow@gmail.com>
Signed-off-by: Keith Zantow <kzantow@gmail.com>
Signed-off-by: Keith Zantow <kzantow@gmail.com>
Signed-off-by: Keith Zantow <kzantow@gmail.com>
@kzantow kzantow dismissed willmurphyscode’s stale review May 21, 2024 19:10

Reworked test actions

Signed-off-by: Keith Zantow <kzantow@gmail.com>
Signed-off-by: Keith Zantow <kzantow@gmail.com>
@kzantow kzantow merged commit b4a7247 into anchore:main May 23, 2024
31 checks passed
@kzantow kzantow deleted the fix/execute-on-windows branch May 23, 2024 15:35
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.

Support for windows
2 participants