Skip to content

Fixed CCUD CI detection when using wsl-bash on GHA #643

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

Merged
merged 1 commit into from
Jul 30, 2024
Merged

Conversation

ribafish
Copy link
Member

@ribafish ribafish commented Jul 30, 2024

Added the CCUD necessary env vars to the WSLENV for wsl-bash githubActions testing.

Until now, cross-platform tests on windows, which use wsl-bash shell did not correctly pick up that this was executed on github actions. This is not an issue of CCUD, it's an issue of WSL, which by default doesn't "forward" env vars set in Windows (host) by default. The only way to forward them is to set them using WSLENV - see discussion and Microsoft blog. You can also observe that in this test project, where the env vars are printed out. All of them are available with the default windows shell (pwsh), but almost none are there with wsl. When WSLENV is configured, the specified vars are available, which also means that CCUD will tag the build correctly, as well as add all of the other values.

Note: These are the two cross-platform runs with these changes:

  1. Run Cross-Platform Tests (Use Development Release) - Example scan with custom data
  2. Run Cross-Platform Tests (Build From Source) - Example scan with custom data

Copy link
Member

@jprinet jprinet left a comment

Choose a reason for hiding this comment

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

Very interesting finding, thanks Gasper!

@runningcode
Copy link
Contributor

Nice find and fix! Does this mean that customers who are experiencing this will also have to do the same fix if they are using github actions?

@ribafish
Copy link
Member Author

Yes, however if they're using WSL, they should already be aware of this, so they hopefully have this in place already. But if they don't we can direct them here.

@ribafish ribafish merged commit 99a9e60 into main Jul 30, 2024
38 checks passed
@ribafish ribafish deleted the fixWslTests branch July 30, 2024 15:07
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.

3 participants