mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-05-28 09:44:53 -04:00
[v14.0/forgejo] feat: add Forgejo server version to runner context (#10643)
Some checks failed
/ release (push) Has been cancelled
testing-integration / test-unit (push) Has been cancelled
testing-integration / test-sqlite (push) Has been cancelled
testing-integration / test-mariadb (v10.6) (push) Has been cancelled
testing-integration / test-mariadb (v11.8) (push) Has been cancelled
testing / backend-checks (push) Has been cancelled
testing / frontend-checks (push) Has been cancelled
testing / test-unit (push) Has been cancelled
testing / test-e2e (push) Has been cancelled
testing / test-remote-cacher (redis) (push) Has been cancelled
testing / test-remote-cacher (valkey) (push) Has been cancelled
testing / test-remote-cacher (garnet) (push) Has been cancelled
testing / test-remote-cacher (redict) (push) Has been cancelled
testing / test-mysql (push) Has been cancelled
testing / test-pgsql (push) Has been cancelled
testing / test-sqlite (push) Has been cancelled
testing / security-check (push) Has been cancelled
Some checks failed
/ release (push) Has been cancelled
testing-integration / test-unit (push) Has been cancelled
testing-integration / test-sqlite (push) Has been cancelled
testing-integration / test-mariadb (v10.6) (push) Has been cancelled
testing-integration / test-mariadb (v11.8) (push) Has been cancelled
testing / backend-checks (push) Has been cancelled
testing / frontend-checks (push) Has been cancelled
testing / test-unit (push) Has been cancelled
testing / test-e2e (push) Has been cancelled
testing / test-remote-cacher (redis) (push) Has been cancelled
testing / test-remote-cacher (valkey) (push) Has been cancelled
testing / test-remote-cacher (garnet) (push) Has been cancelled
testing / test-remote-cacher (redict) (push) Has been cancelled
testing / test-mysql (push) Has been cancelled
testing / test-pgsql (push) Has been cancelled
testing / test-sqlite (push) Has been cancelled
testing / security-check (push) Has been cancelled
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/10642 Currently, there's no way for actions runners to know what version of Forgejo is running on the server side. This makes it difficult/impossible to know which features are available and can make maintaining compatibility tricky. Let's add the Forgejo server version to the context. See associated PR in the runner repo: https://code.forgejo.org/forgejo/runner/pulls/1249 Co-authored-by: John Moon <john.moon@vts-i.com> Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/10643 Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org> Reviewed-by: Michael Kriese <michael.kriese@gmx.de> Reviewed-by: Beowulf <beowulf@beocode.eu> Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org> Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
This commit is contained in:
parent
180ebee6de
commit
766104acae
2 changed files with 2 additions and 0 deletions
|
|
@ -101,6 +101,7 @@ func GenerateGiteaContext(run *actions_model.ActionRun, job *actions_model.Actio
|
|||
|
||||
// additional contexts
|
||||
gitContext["gitea_default_actions_url"] = setting.Actions.DefaultActionsURL.URL()
|
||||
gitContext["forgejo_server_version"] = setting.AppVer
|
||||
|
||||
if job != nil {
|
||||
gitContext["job"] = job.JobID
|
||||
|
|
|
|||
|
|
@ -443,6 +443,7 @@ jobs:
|
|||
assert.Equal(t, actionRun.WorkflowID, gtCtx["workflow"].GetStringValue())
|
||||
assert.Equal(t, "user2/actions-gitea-context/.gitea/workflows/pull.yml@refs/pull/1/head", gtCtx["workflow_ref"].GetStringValue())
|
||||
assert.Equal(t, setting.Actions.DefaultActionsURL.URL(), gtCtx["gitea_default_actions_url"].GetStringValue())
|
||||
assert.Equal(t, setting.AppVer, gtCtx["forgejo_server_version"].GetStringValue())
|
||||
token := gtCtx["token"].GetStringValue()
|
||||
assert.Equal(t, actionTask.TokenLastEight, token[len(token)-8:])
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue