action should allow for arbitrary git repository addresses #14653

Open
opened 2025-11-02 11:19:05 -06:00 by GiteaMirror · 9 comments
Owner

Originally created by @akkuman on GitHub (Jun 25, 2025).

Description

For network reasons, we made a github mirror proxy in the following format
https://xxx.com/https://github.com/actions/checkout@v4
I use it in gitea action as follows

jobs: 
 build: 
 runs-on: ubuntu-latest 
 if. ${{ github.event.inputs.rebuild == 'true' }} 
 steps.
      - name: Checkout 
 uses: https://xxx.com/https://github.com/actions/checkout@v4 
 with: 
 ref: ${{ inputs.ref }}

Will report error Expected format {org}/{repo}[/path]@ref. Actual ‘https://ghfast.top/https://github.com/actions/checkout@v4’ Input string was not in a correct format.

Gitea Version

1.24.0

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

docker compose

Database

None

Originally created by @akkuman on GitHub (Jun 25, 2025). ### Description For network reasons, we made a github mirror proxy in the following format https://xxx.com/https://github.com/actions/checkout@v4 I use it in gitea action as follows ``` jobs: build: runs-on: ubuntu-latest if. ${{ github.event.inputs.rebuild == 'true' }} steps. - name: Checkout uses: https://xxx.com/https://github.com/actions/checkout@v4 with: ref: ${{ inputs.ref }} ``` Will report error `Expected format {org}/{repo}[/path]@ref. Actual ‘https://ghfast.top/https://github.com/actions/checkout@v4’ Input string was not in a correct format`. ### Gitea Version 1.24.0 ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? docker compose ### Database None
GiteaMirror added the topic/gitea-actionstype/bug labels 2025-11-02 11:19:05 -06:00
Author
Owner

@silverwind commented on GitHub (Jun 25, 2025):

I agree, we should drop this validation.

@silverwind commented on GitHub (Jun 25, 2025): I agree, we should drop this validation.
Author
Owner

@ChristopherHX commented on GitHub (Jun 26, 2025):

Ah, I remember this discussion. More than just validation, this is more complex.

Imagine
uses: https://xxx.com/https://github.com/actions/cache/save@v4

where save is a folder of the repository and yes this action does exist and works without the additional url prefix

Only supporting top level actions for absolute urls, could be a solution to lift the url path restriction and causing a new restriction where in the repository an action.yml can be used.

Using another token to separate url path from repo path could help a deterministic parser to accept both. (while :/ is not applicable based on the original post)

Adding a new uses: { url: https://xxx.com/https://github.com/actions/checkout, path: "/", ref: v2 } could allow both. (Needs changes to workflow model)

@ChristopherHX commented on GitHub (Jun 26, 2025): Ah, I remember this discussion. More than just validation, this is more complex. Imagine `uses: https://xxx.com/https://github.com/actions/cache/save@v4` where save is a folder of the repository and yes this action does exist and works without the additional url prefix _Only supporting top level actions for absolute urls, could be a solution to lift the url path restriction and causing a new restriction where in the repository an action.yml can be used._ Using another token to separate url path from repo path could help a deterministic parser to accept both. (while :/ is not applicable based on the original post) Adding a new `uses: { url: https://xxx.com/https://github.com/actions/checkout, path: "/", ref: v2 }` could allow both. (Needs changes to workflow model)
Author
Owner

@akkuman commented on GitHub (Jun 30, 2025):

Perhaps adding a github_mirror(default https://github.com) configuration option to act_runner would also solve this issue I raised. If you guys approve of this option, I will try to submit a PR

@akkuman commented on GitHub (Jun 30, 2025): Perhaps adding a `github_mirror`(default https://github.com) configuration option to act_runner would also solve this issue I raised. If you guys approve of this option, I will try to submit a PR
Author
Owner

@akkuman commented on GitHub (Jun 30, 2025):

In fact, there's another aspect to this problem. If I use an action that has a dependency on another action, even if I configure the url of the action I want to use, the action that the action introduces will still pull from github.
like 02882cc2d9/action.yml (L127-L132)

@akkuman commented on GitHub (Jun 30, 2025): In fact, there's another aspect to this problem. If I use an action that has a dependency on another action, even if I configure the url of the action I want to use, the action that the action introduces will still pull from github. like https://github.com/rustic-beans/dagger-for-github/blob/02882cc2d9faf40e481120cfa4d754a5198c67f2/action.yml#L127-L132
Author
Owner

@akkuman commented on GitHub (Jun 30, 2025):

In this case, having a github_mirror option would solve the problem I think

@akkuman commented on GitHub (Jun 30, 2025): In this case, having a github_mirror option would solve the problem I think
Author
Owner

@lunny commented on GitHub (Jun 30, 2025):

Perhaps adding a github_mirror(default https://github.com) configuration option to act_runner would also solve this issue I raised. If you guys approve of this option, I will try to submit a PR

So that it looks like ?

mirror_server: https://ghfast.top
use: https://github.com/actions/checkout@v4

Maybe the mirror_server should be a global setting or a workflow level setting.

@lunny commented on GitHub (Jun 30, 2025): > Perhaps adding a `github_mirror`(default https://github.com) configuration option to act_runner would also solve this issue I raised. If you guys approve of this option, I will try to submit a PR So that it looks like ? ``` mirror_server: https://ghfast.top use: https://github.com/actions/checkout@v4 ``` Maybe the mirror_server should be a global setting or a workflow level setting.
Author
Owner

@akkuman commented on GitHub (Jul 1, 2025):

I think he should behave more like replacing https://github.com
e.g.

This should accommodate more cases.

This option will only work if the user is using an action that starts with https://github.com or does not start with http:// or https:// (which means it's a github action) and DEFAULT_ACTIONS_URL=github

in these cases

DEFAULT_ACTIONS_URL=github
uses: actions/checkout@v4
uses: https://github.com/actions/checkout@v4

@lunny

@akkuman commented on GitHub (Jul 1, 2025): I think he should behave more like replacing https://github.com e.g. - https://github.com -> https://ghfast.top/https://github.com - https://github.com -> https://kkgithub.com This should accommodate more cases. This option will only work if the user is using an action that starts with https://github.com or does not start with http:// or https:// (which means it's a github action) and DEFAULT_ACTIONS_URL=github in these cases ``` DEFAULT_ACTIONS_URL=github uses: actions/checkout@v4 ``` ``` uses: https://github.com/actions/checkout@v4 ``` @lunny
Author
Owner

@lunny commented on GitHub (Jul 1, 2025):

The behavior was changed to resolve #24789

@lunny commented on GitHub (Jul 1, 2025): The behavior was changed to resolve #24789
Author
Owner

@akkuman commented on GitHub (Jul 2, 2025):

I looked at this solution and this issue and they don't seem to be in conflict

@akkuman commented on GitHub (Jul 2, 2025): I looked at this solution and this issue and they don't seem to be in conflict
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#14653