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

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

Open
mkody opened this issue Sep 1, 2023 · 0 comments
Open

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

mkody opened this issue Sep 1, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@mkody
Copy link

mkody commented Sep 1, 2023

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
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants