From 463c670d06cd488a242c4a4e1d36ae03eb25122c Mon Sep 17 00:00:00 2001 From: Excellencedev Date: Sat, 20 Dec 2025 08:28:58 +0100 Subject: [PATCH] issue fix --- tests/integration/actions_job_token_test.go | 26 ++++++++++++--------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/tests/integration/actions_job_token_test.go b/tests/integration/actions_job_token_test.go index 705a5be89f..58980e482b 100644 --- a/tests/integration/actions_job_token_test.go +++ b/tests/integration/actions_job_token_test.go @@ -311,18 +311,22 @@ func TestActionsCrossRepoAccess(t *testing.T) { } repoAID := createRepoInOrg("repo-A") - // repoB_ID is unused as we access it via API name - createRepoInOrg("repo-B") + repoBID := createRepoInOrg("repo-B") - // 3. Enable Actions in Repo A (Source) - err := db.Insert(t.Context(), &repo_model.RepoUnit{ - RepoID: repoAID, - Type: unit_model.TypeActions, - Config: &repo_model.ActionsConfig{ - TokenPermissionMode: repo_model.ActionsTokenPermissionModePermissive, - }, - }) - require.NoError(t, err) + // 3. Enable Actions in Repo A (Source) and Repo B (Target) + enableActions := func(repoID int64) { + err := db.Insert(t.Context(), &repo_model.RepoUnit{ + RepoID: repoID, + Type: unit_model.TypeActions, + Config: &repo_model.ActionsConfig{ + TokenPermissionMode: repo_model.ActionsTokenPermissionModePermissive, + }, + }) + require.NoError(t, err) + } + + enableActions(repoAID) + enableActions(repoBID) // 4. Create Task in Repo A task := &actions_model.ActionTask{