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

[actions] Cannot use an action hosted in a private repository owned by the same user #24621

Open
thomas-maurice opened this issue May 9, 2023 · 4 comments
Labels
topic/gitea-actions related to the actions of Gitea type/bug

Comments

@thomas-maurice
Copy link

Description

It does not seem to be possible to use an action hosted on a private gitea instance (the runner being registered on the said instance, and the user owning both repos), the runner fails in the setup phase with:

Unable to clone https://XXX/thomas/actions refs/heads/latest: authentication required

The sample .gitea/workflows/pr.yml I used was

---
name: Test pull requests
run-name: ${{ github.actor }} is doing a PR
concurrency:
  cancel-in-progress: true
on: [pull_request]
jobs:
  "Test and build":
    runs-on: ubuntu-latest
    permissions:
      pull-requests: write
      contents: read
      repository-projects: read
    steps:
      - uses: https://XXX/thomas/actions/setup@latest

As you see I tried to add a bunch of permissions but it didn't seem to do anything (I was working under the assumption these would work the same as github, might be wrong)

I also tried to put an ssh:// cloning scheme but it failed as well with

Expected format {org}/{repo}[/path]@ref. Actual 'ssh://gitea@XXXXXXXX:PORT/thomas/actions/setup@latest' Input string was not in a correct format

Gitea Version

1.19.3

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

2.34.1

Operating System

Ubuntu 22.04

How are you running Gitea?

Stock binary downloaded from github

Database

PostgreSQL

@sillyguodong sillyguodong added the topic/gitea-actions related to the actions of Gitea label May 10, 2023
@wolfogre
Copy link
Member

I understand. However, permissions doen't not work on Gitea Actions yet. See https://docs.gitea.io/en-us/usage/actions/comparison/#permissions-and-jobsjob_idpermissions

Therefore, the job can only access the related repository and not other private repositories.

@thomas-maurice
Copy link
Author

Oooooh, it makes sense @wolfogre thank you! I wasn't sure if it was a bug or because the feature is still in early days. Thank you for clarifying !

@wolfogre
Copy link
Member

And a proposal for this:

@thomas-maurice
Copy link
Author

Thank you for following up :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic/gitea-actions related to the actions of Gitea type/bug
Projects
None yet
Development

No branches or pull requests

3 participants