docker / docker/scout-action

Change Github API URL (support Gitea/Forgejo)

Open
#15 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement upstream
Dominant language
JavaScript
Stars
141
Forks
53
PR merge metrics
No merged PRs in 30d

Description

Hi!

I wanted to use this action for my Gitea/Forgejo instance. It started pretty well but failed when it tried to fetch comments.

::group::compare
    ...Storing image for indexing
    ✓ Image stored for indexing
    ...Indexing
    ✓ Indexed 1179 packages
    ✓ Provenance obtained from attestation
    ...Pulling
    ✓ Pulled
    ...Storing image for indexing
    ✓ Image stored for indexing
    ...Indexing
    ✓ Indexed 837 packages
    ...Pulling
    ✓ Pulled
::error::GET https://api.github.com/repos/kody/atw-watcher/issues/4/comments?direction=desc&per_page=10&sort=updated: 401 Bad credentials []

The GET would have worked if it was with my instance's domain and base path.

Would adding an input to specify the base API URL be possible?
It would be to replace https://api.github.com with https://<gitea domain>/api/v1.
The comments endpoints should work the same as GitHub's, but just in case here's Gitea's swagger from the demo instance.

This could also make it work with other GitHub API-compatible software.

EDIT: I see some actions use this in their inputs inside action.yml:

inputs:
  github-url:
    description: 'Base url of GitHub API'
    required: false
    default: ${{ github.api_url }}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with action.yml and trace where the comments API request is built from the GitHub API URL. Check how the action currently obtains that URL, then verify the request can target the configured Gitea or Forgejo base path. Done means the comments endpoint uses the supplied base API URL while retaining the existing GitHub default.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, javascript
Domain
api, devops
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.