Skip to content

Commit 1e188a0

Browse files
run ci
1 parent c17ad9e commit 1e188a0

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/test/java/com/contentstack/sdk/TestAsset.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,25 @@ class TestAsset {
1212

1313
private final Logger logger = Logger.getLogger(TestAsset.class.getName());
1414
private String assetUid;
15-
private Stack stack = Credentials.getStack();
15+
private final Stack stack = Credentials.getStack();
1616

17+
private String envChecker() {
18+
String githubActions = System.getenv("GITHUB_ACTIONS");
19+
if (githubActions != null && githubActions.equals("true")) {
20+
System.out.println("Tests are running in GitHub Actions environment.");
21+
String mySecretKey = System.getenv("API_KEY");
22+
System.out.println("My Secret Key: " + mySecretKey);
23+
return "GitHub";
24+
} else {
25+
System.out.println("Tests are running in a local environment.");
26+
return "local";
27+
}
28+
}
1729

1830
@Test
1931
@Order(1)
2032
void testNewAssetLibrary() {
33+
envChecker();
2134
AssetLibrary assets = stack.assetLibrary();
2235
assets.fetchAll(new FetchAssetsCallback() {
2336
@Override

0 commit comments

Comments
 (0)