-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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] Globally resolvable action names #24789
Comments
https://docs.gitea.com/administration/config-cheat-sheet#actions-actions |
I actually wish that With default value APP_URL (host your own actions via relative syntax), ( |
The option is good but it must not be an option, it needs to be hardcoded to ensure it stays globally resolveable. So the proposal is to remove this configurability and hardcode it to If it can not be removed, at least make the default |
No. |
That is not a good idea. |
okay, I can understand that. |
Seems like I misunderstood the intention of this issue, my proposal should be a separate issue then. However in both scenarios is |
Looking closer at podman, it actually has a config that seems to default to:
From that, I take it could be possible to define multiple search prefixes and I would suggest a default of |
The default is hardcoded to |
Yeah, I understand that it's set I would set to |
Yes, I also think github.com is a better default than gitea.com. I have modded my own actions_runner for gitea actions to look also on github.com to find actions. |
I don't think github.com is better than gitea.com. Because some actions may need to be changed which cannot be used directly by Gitea. i.e. All actions which depend on GitHub APIs which Gitea APIs doesn't compatible will be run failed. For those actions, we need to fork and adjust them. Considering 3 different Gitea instances. 1 Public Gitea instances To satisfy all three situations, a configurable item is necessary. |
Maybe we can have a vote:
My option preference is 1 > 2, while 3 is unacceptable to me. |
Please read my comment above. |
Yes, but fork them under a new name so that If we could convince GitHub to support a prefix, those actions would be even runnable (if compatible) on github.com. |
This is a valid concern, and a |
👍 Could I vote |
While not ideal, |
I think we could extend
Trailing slash should be stripped while parsing the setting and subsequent URL join should be with |
I think we should also put out a recommendation to always use FQANs (fully qualified action names), eliminiating any ambiguity on where the action is hosted, e.g.
instead of the ambiguous
We should also push github to support the FQAN syntax, as currently it's not possible to use actions hosted anywhere else than github. |
Another idea that comes to mind: docker images names omit the |
Yes, that also feels more like docker |
Follow https://gitea.com/gitea/act/pulls/58 Resolve go-gitea/gitea#24789 Co-authored-by: Jason Song <i@wolfogre.com> Reviewed-on: https://gitea.com/gitea/act_runner/pulls/200 Reviewed-by: Jason Song <i@wolfogre.com> Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Zettat123 <zettat123@gmail.com> Co-committed-by: Zettat123 <zettat123@gmail.com>
I was toying with the idea of making updates support updating actions to latest versions locally, but given that the So I still strongly recommend we:
This will ensure that when/if Gitea actions becomes popular, action names will always be unambigous globally and users can seamlessly share actions between GitHub and Gitea instances. It will require a bit more verbose syntax, but I think it's only for the better:
|
So I would propose the following course of actions:
The minor inconvenience of adding |
I don't think runner support |
I agree with @silverwind. We had to use |
This sounds like a reasonable approach to me too |
Is it a gitea-only setting and gitea communicates the absolute URL to the runner? gitea/modules/setting/actions.go Line 16 in da6df0d
I think we should get |
I find a very strong reason to make some changes for @silverwind Discord please. |
Don't have time right now, but will check it later there. |
One niceity we can allow ommitting the protocol, so |
I understand, that's what I thought at the beginning, but unfortunately GitHub Actions already support So it's tricky to distinguish between Update: Maybe we could and a leading |
docker treats it as a host if it has |
Not ideal for this, what if |
It'll be the action |
Unfortunatly, gitea allows usernames with FTR: Github forbids |
And it is also possible for hostname not to contain |
You'd do something like |
I want to note that only act and it's derviates clone actions via git. actions/runner downloads tar / zip archives via api after asking the GitHub Instance where it is located (GitHub also applies an allowed repository filter and sends a token to authorized private actions for private repos), which is faster than a full unshallow git clone on a microSD Also the git only server would have to follow the
Since port 80 is http by default, would this mean like docker it contact the server via http and switch after a redirect to https? I thought that the outcome was strict https for short notation
Same question, not everyone uses https within docker compose. Eventually you have to fallback to the http/https notation in these cases. |
To be clear, I agree with any solution that can shorten the path of actions, as long as:
Unfortunately, I cannot figure out a solution to omit protocol if the format is |
…25581) Resolve #24789 ##⚠️ BREAKING⚠️ Before this, `DEFAULT_ACTIONS_URL` cound be set to any custom URLs like `https://gitea.com` or `http://your-git-server,https://gitea.com`, and the default value was `https://gitea.com`. But now, `DEFAULT_ACTIONS_URL` supports only `github`(`https://github.com`) or `self`(the root url of current Gitea instance), and the default value is `github`. If it has configured with a URL, an error log will be displayed and it will fallback to `github`. Actually, what we really want to do is always make it `https://github.com`, however, this may not be acceptable for some instances of internal use, so there's extra support for `self`, but no more, even `https://gitea.com`. Please note that `uses: https://xxx/yyy/zzz` always works and it does exactly what it is supposed to do. Although it's breaking, I belive it should be backported to `v1.20` due to some security issues. Follow-up on the runner side: - https://gitea.com/gitea/act_runner/pulls/262 - https://gitea.com/gitea/act/pulls/70
…o-gitea#25581) Resolve go-gitea#24789 ##⚠️ BREAKING⚠️ Before this, `DEFAULT_ACTIONS_URL` cound be set to any custom URLs like `https://gitea.com` or `http://your-git-server,https://gitea.com`, and the default value was `https://gitea.com`. But now, `DEFAULT_ACTIONS_URL` supports only `github`(`https://github.com`) or `self`(the root url of current Gitea instance), and the default value is `github`. If it has configured with a URL, an error log will be displayed and it will fallback to `github`. Actually, what we really want to do is always make it `https://github.com`, however, this may not be acceptable for some instances of internal use, so there's extra support for `self`, but no more, even `https://gitea.com`. Please note that `uses: https://xxx/yyy/zzz` always works and it does exactly what it is supposed to do. Although it's breaking, I belive it should be backported to `v1.20` due to some security issues. Follow-up on the runner side: - https://gitea.com/gitea/act_runner/pulls/262 - https://gitea.com/gitea/act/pulls/70
…25581) (#25604) Backport #25581 by @wolfogre Resolve #24789 ##⚠️ BREAKING⚠️ Before this, `DEFAULT_ACTIONS_URL` cound be set to any custom URLs like `https://gitea.com` or `http://your-git-server,https://gitea.com`, and the default value was `https://gitea.com`. But now, `DEFAULT_ACTIONS_URL` supports only `github`(`https://github.com`) or `self`(the root url of current Gitea instance), and the default value is `github`. If it has configured with a URL, an error log will be displayed and it will fallback to `github`. Actually, what we really want to do is always make it `https://github.com`, however, this may not be acceptable for some instances of internal use, so there's extra support for `self`, but no more, even `https://gitea.com`. Please note that `uses: https://xxx/yyy/zzz` always works and it does exactly what it is supposed to do. Although it's breaking, I belive it should be backported to `v1.20` due to some security issues. Follow-up on the runner side: - https://gitea.com/gitea/act_runner/pulls/262 - https://gitea.com/gitea/act/pulls/70 Co-authored-by: Jason Song <i@wolfogre.com>
Hey! I believe I understand why this change was made, and I'm happy to keep the default to "github". However, I'd like to understand whether this means I should prefer the GitHub Actions instead of Gitea Actions, when referring to For example, you mirrored a few actions, such as Also, there are several actions in the marketplace that use the Octokit library, which I always believed I should avoid those, because they only work for GitHub and not Gitea, am I correct to say that? I'm just wondering how "safe" it is to default to GitHub, hoping that I will never use an action from GitHub by accident, that could potentially damage my repos or Gitea instance, due to incompatibilities (when Gitea's mirror version would be more compatible). Apologies if something of what I said above doesn't make sense :) Thank you! |
IIRC, yes, the mirror is just a mirror.
Not really, of course the Octokit library is designed for GitHub not Gitea, however, Gitea has a certain degree of compatibility with GitHub, so I would say that most actions can be used on Gitea, even though they are developed based on Octokit. However, I cannot guarantee that all actions will be compatible. We are also working on identifying incompatible actions and making them compatible, but you know, it's a big task. |
Thank you very much for your reply @wolfogre That's really great to know that actions using Octokit are actually safe to use on Gitea! I was trying to avoid any of those, so far :)
Absolutely - I understand! My question above was not at all intending to be a bad criticism - it was just asking for clarification. The work you guys have done for Gitea Actions is outstanding. Well done, really! I've just submitted another donation. I absolutely love what you do 🧡 |
Partially resolve go-gitea/gitea#24789. `act_runner` needs to be improved to parse `gitea_default_actions_url` after this PR merged (https://gitea.com/gitea/act_runner/pulls/200) Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Reviewed-on: https://gitea.com/gitea/act/pulls/58 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Reviewed-by: Jason Song <i@wolfogre.com> Co-authored-by: Zettat123 <zettat123@gmail.com> Co-committed-by: Zettat123 <zettat123@gmail.com>
Issue
Currently when using this on gitea.com:
It will resolve to instance-specific URL
https://gitea.com/actions/setup-python
which I see very problematic because it makes action names ambigous across multiple gitea instances and github itself (where this will work).Proposal
If the action URL is not absolute, assume a hardcoded
https://github.com/
prefix, just like podman and docker assume adocker.io/
prefix on images not having a fully qualified name. This will ensure that action names are unambigously resolvable globally.The text was updated successfully, but these errors were encountered: