Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New input for Pixee API URL #15

Merged
merged 6 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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