You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Restrict [actions].DEFAULT_ACTIONS_URL to only github or self (#25581) (#25604)
Backport #25581 by @wolfogreResolve#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>
Copy file name to clipboardexpand all lines: custom/conf/app.example.ini
+2-2
Original file line number
Diff line number
Diff line change
@@ -2541,8 +2541,8 @@ LEVEL = Info
2541
2541
;; Enable/Disable actions capabilities
2542
2542
;ENABLED = false
2543
2543
;;
2544
-
;; Default address to get action plugins, e.g. the default value means downloading from "https://gitea.com/actions/checkout" for "uses: actions/checkout@v3"
2545
-
;DEFAULT_ACTIONS_URL = https://gitea.com
2544
+
;; Default platform to get action plugins, `github` for `https://github.com`, `self` for the current Gitea instance.
-`DEFAULT_ACTIONS_URL`: **https://gitea.com**: Default address to get action plugins, e.g. the default value means downloading from "<https://gitea.com/actions/checkout>" for "uses: actions/checkout@v3"
1377
+
-`DEFAULT_ACTIONS_URL`: **github**: Default platform to get action plugins, `github` for `https://github.com`, `self`for the current Gitea instance.
1378
1378
-`STORAGE_TYPE`: **local**: Storage type for actions logs, `local` for local disk or `minio` for s3 compatible object storage service, default is `local` or other name defined with `[storage.xxx]`
1379
1379
-`MINIO_BASE_PATH`: **actions_log/**: Minio base path on the bucket only available when STORAGE_TYPE is `minio`
1380
1380
1381
-
`DEFAULT_ACTIONS_URL` indicates where should we find the relative path action plugin. i.e. when use an action in a workflow file like
1382
-
1383
-
```yaml
1384
-
name: versions
1385
-
on:
1386
-
push:
1387
-
branches:
1388
-
- main
1389
-
- releases/*
1390
-
jobs:
1391
-
build:
1392
-
runs-on: ubuntu-latest
1393
-
steps:
1394
-
- uses: actions/checkout@v3
1395
-
```
1396
-
1397
-
Now we need to know how to get actions/checkout, this configuration is the default git server to get it. That means we will get the repository via git clone ${DEFAULT_ACTIONS_URL}/actions/checkout and fetch tag v3.
1398
-
1399
-
To help people who don't want to mirror these actions in their git instances, the default value is https://gitea.com
1400
-
To help people run actions totally in their network, they can change the value and copy all necessary action repositories into their git server.
1381
+
`DEFAULT_ACTIONS_URL` indicates where the Gitea Actions runners should find the actions with relative path.
1382
+
For example, `uses: actions/checkout@v3` means `https://github.com/actions/checkout@v3` since the value of `DEFAULT_ACTIONS_URL` is `github`.
1383
+
And it can be changed to `self` to make it `root_url_of_your_gitea/actions/checkout@v3`.
1401
1384
1402
-
Of course we should support the form in future PRs like
1403
-
1404
-
```yaml
1405
-
steps:
1406
-
- uses: gitea.com/actions/checkout@v3
1407
-
```
1385
+
Please note that using `self` is not recommended for most cases, as it could make names globally ambiguous.
1386
+
Additionally, it requires you to mirror all the actions you need to your Gitea instance, which may not be worth it.
1387
+
Therefore, please use `self` only if you understand what you are doing.
1408
1388
1409
-
although Github don't support this form.
1389
+
In earlier versions (<= 1.19), `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`.
1390
+
However, later updates removed those options, and now the only options are `github` and `self`, with the default value being `github`.
1391
+
However, if you want to use actions from other git server, you can use a complete URL in `uses` field, it's supported by Gitea (but not GitHub).
1392
+
Like `uses: https://gitea.com/actions/checkout@v3` or `uses: http://your-git-server/actions/checkout@v3`.
"workspace": "", // string, The default working directory on the runner for steps, and the default location of your repository when using the checkout action.
0 commit comments