Skip to content

Change Github API URL (support Gitea/Forgejo) #15

Open

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 }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions