@@ -44,6 +44,13 @@ inputs:
4444 description : ' Add this path prefix to the start of file locations'
4545 required : false
4646
47+ # Allows for a custom runner home directory to be specified for self-hosted runners
48+ base_path :
49+ description : ' The home directory of the runner'
50+ required : false
51+ default : ' /home/runner/work'
52+
53+
4754runs :
4855 using : " composite"
4956 steps :
@@ -57,20 +64,20 @@ runs:
5764 id : cache-spotbugs
5865 uses : actions/cache@v3
5966 with :
60- path : /home/runner/work /spotbugs+/spotbugs-${{ inputs.spotbugs_version }}
67+ path : ${{ inputs.base_path }} /spotbugs+/spotbugs-${{ inputs.spotbugs_version }}
6168 key : ${{ runner.os }}-spotbugs-${{ inputs.spotbugs_version }}
6269 - name : Cache FindSecBugs
6370 if : inputs.no_cache == 'false'
6471 id : cache-findsecbugs
6572 uses : actions/cache@v3
6673 with :
67- path : /home/runner/work /findsecbugs+/findsecbugs-plugin-${{ inputs.findsecbugs_version }}.jar
74+ path : ${{ inputs.base_path }} /findsecbugs+/findsecbugs-plugin-${{ inputs.findsecbugs_version }}.jar
6875 key : ${{ runner.os }}-findsecbugs-${{ inputs.findsecbugs_version }}
6976 - name : Get SpotBugs
7077 if : inputs.no_cache == 'true' || steps.cache-spotbugs.outputs.cache-hit != 'true'
7178 env :
7279 INPUT_SPOTBUGS_VERSION : ${{ inputs.spotbugs_version }}
73- SPOTBUGS_HOME : /home/runner/work /spotbugs+/
80+ SPOTBUGS_HOME : ${{ inputs.base_path }} /spotbugs+/
7481 run : |
7582 mkdir -p "${SPOTBUGS_HOME}"
7683 cd "${SPOTBUGS_HOME}"
8491 if : inputs.no_cache == 'true' || steps.cache-findsecbugs.outputs.cache-hit != 'true'
8592 env :
8693 INPUT_FINDSECBUGS_VERSION : ${{ inputs.findsecbugs_version }}
87- FINDSECBUGS_HOME : /home/runner/work /findsecbugs+/
94+ FINDSECBUGS_HOME : ${{ inputs.base_path }} /findsecbugs+/
8895 run : |
8996 mkdir -p "${FINDSECBUGS_HOME}"
9097 cd "${FINDSECBUGS_HOME}"
97104 INPUT_FINDSECBUGS_VERSION : ${{ inputs.findsecbugs_version }}
98105 INPUT_SPOTBUGS_TARGET : ${{ inputs.spotbugs_target }}
99106 INPUT_SPOTBUGS_GLOB : ${{ inputs.spotbugs_filename_glob }}
100- SPOTBUGS_HOME : /home/runner/work /spotbugs+/spotbugs-${{ inputs.spotbugs_version }}
101- FINDSECBUGS_HOME : /home/runner/work /findsecbugs+/
102- SPOTBUGS_WORKING : /home/runner/work /spotbugs_working+/
107+ SPOTBUGS_HOME : ${{ inputs.base_path }} /spotbugs+/spotbugs-${{ inputs.spotbugs_version }}
108+ FINDSECBUGS_HOME : ${{ inputs.base_path }} /findsecbugs+/
109+ SPOTBUGS_WORKING : ${{ inputs.base_path }} /spotbugs_working+/
103110 run : |
104111 mkdir -p "${SPOTBUGS_WORKING}"
105112 cd "${SPOTBUGS_WORKING}"
@@ -110,7 +117,7 @@ runs:
110117 if : inputs.path_prefix != null
111118 env :
112119 INPUT_PATH_PREFIX : ${{ inputs.path_prefix }}
113- SPOTBUGS_WORKING : /home/runner/work /spotbugs_working+/
120+ SPOTBUGS_WORKING : ${{ inputs.base_path }} /spotbugs_working+/
114121 run : |
115122 cd "${SPOTBUGS_WORKING}"
116123 jq --arg prefix "${INPUT_PATH_PREFIX}" '.runs[].results[].locations[].physicalLocation.artifactLocation.uri |= $prefix + .' < spotbugs.sarif > spotbugs_edited.sarif
@@ -121,4 +128,4 @@ runs:
121128 if : inputs.upload_sarif == 'true'
122129 uses : github/codeql-action/upload-sarif@v2
123130 with :
124- sarif_file : /home/runner/work /spotbugs_working+/spotbugs.sarif
131+ sarif_file : ${{ inputs.base_path }} /spotbugs_working+/spotbugs.sarif
0 commit comments