Skip to content

Commit

Permalink
New input for Pixee API URL (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosu7 authored May 16, 2024
1 parent 0256e9b commit 993fda7
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 39,257 deletions.
10 changes: 10 additions & 0 deletions __tests__/pixee-platform.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ import * as github from "../src/github";
import { uploadInputFile } from "../src/pixee-platform";
import axios from "axios";

let getInputMock: jest.SpiedFunction<typeof core.getInput>;
let getIDTokenMock: jest.SpiedFunction<typeof core.getIDToken>;
let getGitHubContextMock: jest.SpiedFunction<typeof github.getGitHubContext>;

describe("pixee-platform", () => {
beforeEach(() => {
jest.clearAllMocks();
getInputMock = jest.spyOn(core, "getInput").mockImplementation();
tmp.setGracefulCleanup();
getIDTokenMock = jest.spyOn(core, "getIDToken").mockResolvedValue("token");
getGitHubContextMock = jest
Expand All @@ -27,6 +29,14 @@ describe("pixee-platform", () => {
fs.writeFileSync(file.name, "{}");
// mock axios.put to avoid making a real HTTP request
jest.spyOn(axios, "put").mockResolvedValue(undefined);
getInputMock.mockImplementation((name: string) => {
switch (name) {
case "pixee-api-url":
return "https://api.pixee.ai";
default:
return "";
}
});

await uploadInputFile("sonar_issues", file.name);

Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ description:
automatically fix issues found.

inputs:
pixee-api-url:
description: The base URL of the Pixee API
default: https://api.pixee.ai
tool:
description: >
The supported code scanning tool that produced the results being uploaded.
Expand Down
Loading

0 comments on commit 993fda7

Please sign in to comment.