Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b659eb5

Browse files
committedFeb 15, 2025·
fix
1 parent b90e9c1 commit b659eb5

File tree

2 files changed

+10
-16
lines changed

2 files changed

+10
-16
lines changed
 

‎.github/workflows/ossf-scorecard.yml

+5-11
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
1-
name: OSSF Scorecard
1+
name: OpenSSF Scorecard analysis
22

33
on:
44
push:
55
branches:
66
- main
77
schedule:
88
- cron: "43 6 * * 5" # weekly at 06:43 (UTC) on Friday
9-
workflow_dispatch:
109

1110
permissions: read-all
1211

1312
jobs:
1413
analysis:
1514
runs-on: ubuntu-latest
1615
permissions:
17-
# Needed for Code scanning upload
18-
security-events: write
19-
# Needed for GitHub OIDC token if publish_results is true
20-
id-token: write
16+
security-events: write # for Code scanning upload
17+
id-token: write # for authentication when uploading to scorecard
2118
steps:
2219
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2320
with:
@@ -29,18 +26,15 @@ jobs:
2926
results_format: sarif
3027
publish_results: true
3128

32-
# Upload the results as artifacts (optional). Commenting out will disable
33-
# uploads of run results in SARIF format to the repository Actions tab.
34-
# https://docs.github.com/en/actions/advanced-guides/storing-workflow-data-as-artifacts
29+
# Upload the results as artifacts
3530
- name: "Upload artifact"
3631
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
3732
with:
3833
name: SARIF file
3934
path: results.sarif
4035
retention-days: 5
4136

42-
# Upload the results to GitHub's code scanning dashboard (optional).
43-
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
37+
# Upload the results to GitHub's code scanning dashboard
4438
- name: "Upload to code-scanning"
4539
uses: github/codeql-action/upload-sarif@9e8d0789d4a0fa9ceb6b1738f7e269594bdd67f0 # v3.28.9
4640
with:

‎smoke-tests-otel-starter/spring-boot-3/src/test/java/io/opentelemetry/spring/smoketest/OtelSpringStarterSmokeTest.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class OtelSpringStarterSmokeTest extends AbstractOtelSpringStarterSmokeTest {
2626

2727
@Override
2828
protected void assertAdditionalMetrics() {
29-
if (!isJfrAvailable()) {
29+
if (!isFlightRecorderAvailable()) {
3030
return;
3131
}
3232

@@ -50,11 +50,11 @@ protected void assertAdditionalMetrics() {
5050
}
5151
}
5252

53-
private static boolean isJfrAvailable() {
53+
private static boolean isFlightRecorderAvailable() {
5454
try {
55-
Class.forName("jdk.jfr.FlightRecorder");
56-
return true;
57-
} catch (ClassNotFoundException exception) {
55+
return (boolean)
56+
Class.forName("jdk.jfr.FlightRecorder").getMethod("isAvailable").invoke(null);
57+
} catch (ReflectiveOperationException exception) {
5858
return false;
5959
}
6060
}

0 commit comments

Comments
 (0)
Please sign in to comment.