0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-05-07 03:53:54 +02:00
This commit is contained in:
Excellencedev 2026-01-02 10:42:18 +01:00
parent 285f366f22
commit be52d4a338

View File

@ -568,6 +568,18 @@ jobs:
cfg := actionsUnit.ActionsConfig()
defaultPerms := cfg.GetEffectiveTokenPermissions(false)
// Create Run (shared)
run := &actions_model.ActionRun{
RepoID: repository.ID,
OwnerID: repository.Owner.ID,
Title: "Test workflow permissions",
Status: actions_model.StatusRunning,
Ref: "refs/heads/master",
CommitSHA: "abc123456",
TriggerUserID: repository.Owner.ID,
}
require.NoError(t, db.Insert(t.Context(), run))
// Iterate over jobs and create them matching the parser logic
for _, flow := range singleWorkflows {
jobID, jobDef := flow.Job()
@ -581,18 +593,6 @@ jobs:
finalPerms := cfg.ClampPermissions(jobPerms)
permsJSON := repo_model.MarshalTokenPermissions(finalPerms)
// Create Run (shared)
run := &actions_model.ActionRun{
RepoID: repository.ID,
OwnerID: repository.Owner.ID,
Title: "Test workflow permissions",
Status: actions_model.StatusRunning,
Ref: "refs/heads/master",
CommitSHA: "abc123456",
TriggerUserID: repository.Owner.ID,
}
require.NoError(t, db.Insert(t.Context(), run))
job := &actions_model.ActionRunJob{
RunID: run.ID,
RepoID: repository.ID,