PR comment not working on self-hosted GHES instance
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 141
- Forks
- 53
- PR merge metrics
- No merged PRs in 30d
Description
Summary
This action is not respecting the GitHub API URL provided from the context / environment.
Details
Running this action on a self-hosted GitHub Enterprise Server (GHES) instance with a pull_request trigger fails with the following log entry:
quickview
✓ Provenance obtained from attestation
✓ SBOM obtained from attestation, 265 packages indexed
! Policy evaluation skipped: %w no organization configured, use --org or run 'docker scout config' to view policy results
Error: GET https://api.github.com/repos/<org_name>/<repo_name>/issues/56/comments?direction=desc&per_page=10&sort=updated: 401 Bad credentials []
The issue is that it tries to access api.github.com with the job credentials for our private GHES instance.
Proposed Solutions
Solution 1
This action should not not hardcode the API URL, but use the GitHub context variable ${{ github.api_url }} or its respective mapped environment variable $GITHUB_API_URL. See the GitHub Actions documentaion for further details.
Solution 2
Add an input to configure the API URL and default it to ${{ github.api_url }} as suggested in #15
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source file or test is named. Start by locating where the action builds the GitHub API URL, then trace how the pull_request context or environment is read. Done means comment requests use the configured GHES API URL instead of api.github.com and the action works with GHES credentials.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, javascript
- Domain
- ci-cd
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100