You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: exercises/lab 3 - code-scanning.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,12 +29,12 @@ CodeQL requires a build of compiled languages. An analysis job can fail if our *
29
29
30
30
1. Inside the workflow you'll see a list of jobs on the left. Click on the Java job to view the logging output and review any errors to determine if there's a build failure.
31
31
32
-
2. The build failure appears to be caused by a JDK version mismatch. Our project targets JDK version 15. How can we check the Java version that the GitHub hosted runner is using? Does the logging output provide any helpful information?
32
+
2. The `autobuild` compilation failure appears to be caused by a JDK version mismatch. Our project targets JDK version 15. How can we check the Java version that the GitHub hosted runner is using? Does the logging output provide any helpful information?
33
33
34
34
<details>
35
35
<summary>Solution</summary>
36
36
37
-
- GitHub saves workflow files in the `.github/workflows` directory of your repository. You can add a command to the workflow that returns the Java version.
37
+
- GitHub saves workflow files in the `.github/workflows` directory of your repository. You can add a command to the existing `codeql-analysis.yml`workflow to output the Java version. Add this anywhere before the step that is failing to help in your debugging:
38
38
39
39
```yaml
40
40
- run: |
@@ -44,7 +44,7 @@ CodeQL requires a build of compiled languages. An analysis job can fail if our *
44
44
45
45
</details>
46
46
47
-
3. Resolve the JDK version issue by using the `setup-java` Action to specify a version.
47
+
3. The previous debugging has concluded that we have a mismatch. Resolve the JDK version issue by using the `setup-java` Action in `codeql-analysis.yml` to explicitly specify a version. This should be added to the workflow before the `autobuild` step to properly configure the runtime environment before the build.
48
48
49
49
<details>
50
50
<summary>Solution</summary>
@@ -59,7 +59,7 @@ CodeQL requires a build of compiled languages. An analysis job can fail if our *
59
59
60
60
#### Using context and expressions to modify build
61
61
62
-
How would you [modify](https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions) the workflow such that the autobuild step only targets Java?
62
+
How would you [modify](https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions) the workflow such that the autobuild step only targets compiled languages (`java` in our repository)?
63
63
64
64
<details>
65
65
<summary>Solution</summary>
@@ -68,7 +68,7 @@ How would you [modify](https://docs.github.com/en/free-pro-team@latest/actions/r
0 commit comments