@@ -1606,15 +1606,15 @@ func TestPullRequestWithPathsRebase(t *testing.T) {
16061606 repoName := "actions-pr-paths-rebase"
16071607 apiRepo := createActionsTestRepo (t , token , repoName , false )
16081608 repo := unittest .AssertExistsAndLoadBean (t , & repo_model.Repository {ID : apiRepo .ID })
1609- apiCtx := NewAPITestContext (t , "user2" , repoName , auth_model .AccessTokenScopeWriteRepository )
1609+ apiCtx := NewAPITestContext (t , "user2" , repoName , repo . GroupID , auth_model .AccessTokenScopeWriteRepository )
16101610 runner := newMockRunner ()
16111611 runner .registerAsRepoRunner (t , "user2" , repoName , "mock-runner" , []string {"ubuntu-latest" }, false )
16121612
16131613 // init files and dirs
1614- testCreateFile (t , session , "user2" , repoName , repo .DefaultBranch , "" , "dir1/dir1.txt" , "1" )
1615- testCreateFile (t , session , "user2" , repoName , repo .DefaultBranch , "" , "dir2/dir2.txt" , "2" )
1614+ testCreateFile (t , session , repo . GroupID , "user2" , repoName , repo .DefaultBranch , "" , "dir1/dir1.txt" , "1" )
1615+ testCreateFile (t , session , repo . GroupID , "user2" , repoName , repo .DefaultBranch , "" , "dir2/dir2.txt" , "2" )
16161616 wfFileContent := `name: ci
1617- on:
1617+ on:
16181618 pull_request:
16191619 paths:
16201620 - 'dir1/**'
@@ -1624,22 +1624,22 @@ jobs:
16241624 steps:
16251625 - run: echo 'ci'
16261626`
1627- testCreateFile (t , session , "user2" , repoName , repo .DefaultBranch , "" , ".gitea/workflows/ci.yml" , wfFileContent )
1627+ testCreateFile (t , session , repo . GroupID , "user2" , repoName , repo .DefaultBranch , "" , ".gitea/workflows/ci.yml" , wfFileContent )
16281628
16291629 // create a PR to modify "dir1/dir1.txt", the workflow will be triggered
1630- testEditFileToNewBranch (t , session , "user2" , repoName , repo .DefaultBranch , "update-dir1" , "dir1/dir1.txt" , "11" )
1630+ testEditFileToNewBranch (t , session , repo . GroupID , "user2" , repoName , repo .DefaultBranch , "update-dir1" , "dir1/dir1.txt" , "11" )
16311631 _ , err := doAPICreatePullRequest (apiCtx , "user2" , repoName , repo .DefaultBranch , "update-dir1" )(t )
16321632 assert .NoError (t , err )
16331633 pr1Task := runner .fetchTask (t )
16341634 _ , _ , pr1Run := getTaskAndJobAndRunByTaskID (t , pr1Task .Id )
16351635 assert .Equal (t , webhook_module .HookEventPullRequest , pr1Run .Event )
16361636
16371637 // create a PR to modify "dir2/dir2.txt" then update main branch and rebase, the workflow will not be triggered
1638- testEditFileToNewBranch (t , session , "user2" , repoName , repo .DefaultBranch , "update-dir2" , "dir2/dir2.txt" , "22" )
1638+ testEditFileToNewBranch (t , session , repo . GroupID , "user2" , repoName , repo .DefaultBranch , "update-dir2" , "dir2/dir2.txt" , "22" )
16391639 apiPull , err := doAPICreatePullRequest (apiCtx , "user2" , repoName , repo .DefaultBranch , "update-dir2" )(t )
16401640 runner .fetchNoTask (t )
16411641 assert .NoError (t , err )
1642- testEditFile (t , session , "user2" , repoName , repo .DefaultBranch , "dir1/dir1.txt" , "11" ) // change the file in "dir1"
1642+ testEditFile (t , session , repo . GroupID , "user2" , repoName , repo .DefaultBranch , "dir1/dir1.txt" , "11" ) // change the file in "dir1"
16431643 req := NewRequestWithValues (t , "POST" ,
16441644 fmt .Sprintf ("/%s/%s/pulls/%d/update?style=rebase" , "user2" , repoName , apiPull .Index ), // update by rebase
16451645 map [string ]string {
0 commit comments