We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b30a546 commit 684c7b7Copy full SHA for 684c7b7
Package.swift
@@ -479,6 +479,10 @@ extension Array where Element == PackageDescription.CXXSetting {
479
result.append(.define("SWT_TESTING_LIBRARY_COMMIT_HASH", to: #""\#(git.currentCommit)""#))
480
if git.hasUncommittedChanges {
481
result.append(.define("SWT_TESTING_LIBRARY_COMMIT_MODIFIED", to: "1"))
482
+ } else if let gitHubSHA = Context.environment["GITHUB_SHA"] {
483
+ // When building in GitHub Actions, the git command may fail to get us the
484
+ // commit hash, so check if GitHub shared it with us instead.
485
+ result.append(.define("SWT_TESTING_LIBRARY_COMMIT_HASH", to: #""\#(gitHubSHA)""#))
486
}
487
488
0 commit comments