mirror of
https://github.com/github/codeql-action.git
synced 2026-10-03 17:41:28 +00:00
Fix invalid api call for local run
This commit is contained in:
3
lib/actions-util.js
generated
3
lib/actions-util.js
generated
@@ -99,6 +99,9 @@ async function getWorkflowPath() {
|
|||||||
const owner = repo_nwo[0];
|
const owner = repo_nwo[0];
|
||||||
const repo = repo_nwo[1];
|
const repo = repo_nwo[1];
|
||||||
const run_id = Number(getRequiredEnvParam("GITHUB_RUN_ID"));
|
const run_id = Number(getRequiredEnvParam("GITHUB_RUN_ID"));
|
||||||
|
if (util_1.isLocalRun()) {
|
||||||
|
return 'n/a';
|
||||||
|
}
|
||||||
const apiClient = api.getActionsApiClient();
|
const apiClient = api.getActionsApiClient();
|
||||||
const runsResponse = await apiClient.request("GET /repos/:owner/:repo/actions/runs/:run_id", {
|
const runsResponse = await apiClient.request("GET /repos/:owner/:repo/actions/runs/:run_id", {
|
||||||
owner,
|
owner,
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -96,6 +96,10 @@ async function getWorkflowPath(): Promise<string> {
|
|||||||
const repo = repo_nwo[1];
|
const repo = repo_nwo[1];
|
||||||
const run_id = Number(getRequiredEnvParam("GITHUB_RUN_ID"));
|
const run_id = Number(getRequiredEnvParam("GITHUB_RUN_ID"));
|
||||||
|
|
||||||
|
if (isLocalRun()) {
|
||||||
|
return 'n/a';
|
||||||
|
}
|
||||||
|
|
||||||
const apiClient = api.getActionsApiClient();
|
const apiClient = api.getActionsApiClient();
|
||||||
const runsResponse = await apiClient.request(
|
const runsResponse = await apiClient.request(
|
||||||
"GET /repos/:owner/:repo/actions/runs/:run_id",
|
"GET /repos/:owner/:repo/actions/runs/:run_id",
|
||||||
|
|||||||
Reference in New Issue
Block a user