Add workload_run_attempt to analysis upload (#1658)
* Refactor status report upload logic Previously we had duplicated the logic to check `GITHUB_RUN_ID`. We now call the `getWorkflowRunID()` method for the status report upload method, and move the logic for the run attempt to `getWorkflowRunAttempt()` * Add `workflow_run_attempt` to analysis payload * Stop allowing `undefined` run IDs and attempts Because we already throw an error if the ID or attempt aren't numbers, we don't have to allow `undefined` values into the payload.
This commit is contained in:
parent
a9648ea7c6
commit
da583b07a7
12 changed files with 85 additions and 42 deletions
12
lib/actions-util.js
generated
12
lib/actions-util.js
generated
|
|
@ -290,16 +290,8 @@ exports.getActionVersion = getActionVersion;
|
|||
async function createStatusReportBase(actionName, status, actionStartedAt, cause, exception) {
|
||||
const commitOid = (0, exports.getOptionalInput)("sha") || process.env["GITHUB_SHA"] || "";
|
||||
const ref = await getRef();
|
||||
const workflowRunIDStr = process.env["GITHUB_RUN_ID"];
|
||||
let workflowRunID = -1;
|
||||
if (workflowRunIDStr) {
|
||||
workflowRunID = parseInt(workflowRunIDStr, 10);
|
||||
}
|
||||
const workflowRunAttemptStr = process.env["GITHUB_RUN_ATTEMPT"];
|
||||
let workflowRunAttempt = -1;
|
||||
if (workflowRunAttemptStr) {
|
||||
workflowRunAttempt = parseInt(workflowRunAttemptStr, 10);
|
||||
}
|
||||
const workflowRunID = (0, workflow_1.getWorkflowRunID)();
|
||||
const workflowRunAttempt = (0, workflow_1.getWorkflowRunAttempt)();
|
||||
const workflowName = process.env["GITHUB_WORKFLOW"] || "";
|
||||
const jobName = process.env["GITHUB_JOB"] || "";
|
||||
const analysis_key = await getAnalysisKey();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue