Actions Artifacts v4 backend (#2224)

* Actions Artifacts v4 backend

* lint

* fix it now

* remove protofile, to make linter not complain

* sync changes

* add delete

* import auth test from gitea

* add more tests

* codecov ignore protobuf
This commit is contained in:
ChristopherHX
2024-05-20 22:00:04 +02:00
committed by GitHub
parent 8acde99bfa
commit e1e5671e3d
12 changed files with 1836 additions and 37 deletions

View File

@@ -15,6 +15,7 @@ import (
"path/filepath"
"regexp"
"runtime"
"strconv"
"strings"
"github.com/docker/go-connections/nat"
@@ -962,10 +963,15 @@ func setActionRuntimeVars(rc *RunContext, env map[string]string) {
actionsRuntimeURL = fmt.Sprintf("http://%s:%s/", rc.Config.ArtifactServerAddr, rc.Config.ArtifactServerPort)
}
env["ACTIONS_RUNTIME_URL"] = actionsRuntimeURL
env["ACTIONS_RESULTS_URL"] = actionsRuntimeURL
actionsRuntimeToken := os.Getenv("ACTIONS_RUNTIME_TOKEN")
if actionsRuntimeToken == "" {
actionsRuntimeToken = "token"
runID := int64(1)
if rid, ok := rc.Config.Env["GITHUB_RUN_ID"]; ok {
runID, _ = strconv.ParseInt(rid, 10, 64)
}
actionsRuntimeToken, _ = common.CreateAuthorizationToken(runID, runID, runID)
}
env["ACTIONS_RUNTIME_TOKEN"] = actionsRuntimeToken
}