go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
44.02k stars 5.4k forks source link

Actions using wrong URL for Repositories #26721

Open OdinVex opened 1 year ago

OdinVex commented 1 year ago

Description

I host my Gitea instance on a subdir of a domain, such as https://example.com/Gitea/ and I've noticed that Actions isn't giving the correct path to the Runner (or jobs?). Gitea Actions Demo was a perfect test and it revealed that it's passing the wrong URL for the repository:

Explore-Gitea-Actions (demo.yaml) relevant line:

remote add origin https://example.com/USER/REPO

It should be https://example.com/Gitea/USER/REPO in my case. It's broken the ability of git to get the repo into the job.

Gitea Version

1.20.3

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

2.39.2

Operating System

Docker Gitea & Gitea Actions

How are you running Gitea?

Multiple ways, but primary test instance is self-hosted via Docker on a reverse-proxy.

Database

None

sosyco commented 1 year ago

Similar configuration, same problem:

But looks like a problem of actions/checkout@v3.

The "Set up job"-output shows at (~ line 25) setupEnv => map[ ...GITHUB_SERVER_URL:https://domain/dev/git ...] the correct url.

Issue on actions/checkout: https://github.com/actions/checkout/issues/1370

Workaround: uses: RouxAntoine/checkout@v3.5.4 :+1:

OdinVex commented 1 year ago

I found this to be helpful, they found the issue long ago: https://gitea.com/ScMi1/checkout

Edit: This one is a fork of Gitea's Action Checkout, thus why I figured to use it.

natesubra commented 7 months ago

This bit me as well.

I have Gitea behind a reverse proxy (Traefik) using a suburl/prefix. Clone addresses etc were fine--and I have the base URL set in my app.ini. Mainly commenting to help make this more discoverable.

Swapping over to one of the forked checkouts does indeed work. Instructions can be found on the README.md of both alternative projects.

OdinVex commented 7 months ago

Microsoft's upstream GitHub action checkout "developers" refuse to adjust the checkout to address this issue. They're essentially telling everyone to **** off, so it'll need forking to un**** it.

natesubra commented 7 months ago

Microsoft's upstream GitHub action checkout "developers" refuse to adjust the checkout to address this issue. They're essentially telling everyone to off, so it'll need forking to un it.

Yeah it's definitely frustrating-- fingers crossed it will make it's way in eventually. Sucks to have to shim an action in nearly every workflow.

OdinVex commented 7 months ago

fingers crossed it will make it's way in eventually

They made a point to say they won't support anything for third-party and that this will definitely not happen.