Skip to content

Add api_url as input#256

Merged
ncalteen merged 2 commits intomainfrom
ncalteen/api-url
Jul 3, 2025
Merged

Add api_url as input#256
ncalteen merged 2 commits intomainfrom
ncalteen/api-url

Conversation

@ncalteen
Copy link
Copy Markdown
Contributor

@ncalteen ncalteen commented Jul 3, 2025

This pull request introduces support for customizing the GitHub API URL in the releaser action. The change adds a new input parameter, api_url, and updates the relevant files to handle this input. Additionally, the version of the package has been incremented to reflect the new functionality.

@ncalteen ncalteen self-assigned this Jul 3, 2025
Copilot AI review requested due to automatic review settings July 3, 2025 14:23
@ncalteen ncalteen requested a review from a team as a code owner July 3, 2025 14:23
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jul 3, 2025

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ ACTION actionlint 5 0 0 0.04s
✅ JSON jsonlint 7 0 0 0.19s
✅ JSON npm-package-json-lint yes no no 0.48s
✅ JSON prettier 7 0 0 0.84s
✅ JSON v8r 7 0 0 9.44s
✅ MARKDOWN markdownlint 1 0 0 0.93s
✅ MARKDOWN markdown-link-check 1 0 0 1.96s
✅ REPOSITORY checkov yes no no 17.74s
✅ REPOSITORY gitleaks yes no no 2.19s
✅ REPOSITORY git_diff yes no no 0.03s
✅ REPOSITORY grype yes no no 33.24s
✅ REPOSITORY secretlint yes no no 1.25s
✅ REPOSITORY syft yes no no 4.54s
✅ REPOSITORY trivy-sbom yes no no 1.54s
✅ REPOSITORY trufflehog yes no no 14.92s
✅ TYPESCRIPT prettier 10 0 0 0.98s
✅ YAML prettier 13 0 0 0.46s
✅ YAML v8r 13 0 0 7.05s
✅ YAML yamllint 13 0 0 0.39s

See detailed report in MegaLinter reports

MegaLinter is graciously provided by OX Security

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new api_url input to allow users to customize the GitHub API endpoint, and threads that value through to the Octokit client. It also updates tests and documentation to cover the new parameter.

  • Introduced api_url input in action.yml
  • Retrieved api_url in src/main.ts and passed it as baseUrl to Octokit
  • Updated tests to mock and assert api_url, and updated README

Reviewed Changes

Copilot reviewed 4 out of 7 changed files in this pull request and generated 1 comment.

File Description
src/main.ts Read api_url input and set baseUrl on Octokit initialization
action.yml Added api_url input metadata
tests/main.test.ts Mocked api_url input and added call assertions
README.md Documented the api_url input and its default value
Files not reviewed (1)
  • package.json: Language not supported
Comments suppressed due to low confidence (2)

src/main.ts:7

  • The api_url input is marked as required in code but declared as optional in action.yml. Consider aligning these by setting required: false or updating the action metadata to required: true.
  const apiUrl = core.getInput('api_url', { required: true })

tests/main.test.ts:56

  • The test asserts that getInput was called, but doesn't verify that Octokit was initialized with the provided apiUrl. Add an assertion like expect(Octokit).toHaveBeenCalledWith({ auth: token, baseUrl: 'https://api.github.com' }) (with proper mocking) to ensure the new parameter is used correctly.
    expect(core.getInput).toHaveBeenCalledWith('api_url', { required: true })

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@ncalteen ncalteen merged commit e676802 into main Jul 3, 2025
5 checks passed
@ncalteen ncalteen deleted the ncalteen/api-url branch July 3, 2025 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants