-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from entur/fix/reduce-scan-times
feat: Optional caching to reduce autobuild times
- Loading branch information
Showing
2 changed files
with
47 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,12 @@ name: 'Entur/Security/Code Scan' | |
|
||
on: | ||
workflow_call: | ||
|
||
inputs: | ||
use_setup_gradle: | ||
description: 'Use "gradle/action/setup-gradle" before running autobuild (Java/Kotlin only). Potentially speeds up build times if cache from main branch is utilized' | ||
default: false | ||
required: false | ||
type: boolean | ||
env: | ||
GITHUB_REPOSITORY: ${{ github.repository }} | ||
|
||
|
@@ -98,7 +103,7 @@ jobs: | |
workflow_runs = workflow_runs.json().get('workflow_runs', []) | ||
run_id = None | ||
for workflow_run in workflow_runs: | ||
if workflow_run.get('path') == '.github/workflows/codeql.yml': | ||
if workflow_run.get('path','').startswith('.github/workflows/codeql.yml'): | ||
run_id = workflow_run.get('id') | ||
with open(env_file, 'a') as f: | ||
|
@@ -237,6 +242,11 @@ jobs: | |
steps: | ||
- name: "Checkout repository" | ||
uses: actions/checkout@v4 | ||
- name: "Set up Gradle for Java/Kotlin" | ||
if: ${{ inputs.use_setup_gradle}} && (matrix.language == 'kotlin' || matrix.language == 'java') | ||
uses: gradle/actions/[email protected] | ||
with: | ||
cache-read-only: true # Force read only, even in main | ||
- name: "Initialize CodeQL for Java/Kotlin" | ||
if: matrix.language == 'kotlin' || matrix.language == 'java' | ||
uses: github/codeql-action/init@v3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters