fix(githttp): skip limited repo check for action tokens
Some checks failed
Build and Release / Create Release (push) Successful in 0s
Build and Release / Unit Tests (push) Failing after 3m13s
Build and Release / Lint (push) Failing after 3m42s
Build and Release / Build Binaries (amd64, linux, linux-latest) (push) Has been skipped
Build and Release / Build Binaries (amd64, windows, windows-latest) (push) Has been skipped
Build and Release / Build Binaries (amd64, darwin, macos) (push) Has been skipped
Build and Release / Build Binaries (arm64, darwin, macos) (push) Has been skipped
Build and Release / Build Binary (linux/arm64) (push) Has been skipped
Build and Release / Integration Tests (PostgreSQL) (push) Successful in 4m12s
Some checks failed
Build and Release / Create Release (push) Successful in 0s
Build and Release / Unit Tests (push) Failing after 3m13s
Build and Release / Lint (push) Failing after 3m42s
Build and Release / Build Binaries (amd64, linux, linux-latest) (push) Has been skipped
Build and Release / Build Binaries (amd64, windows, windows-latest) (push) Has been skipped
Build and Release / Build Binaries (amd64, darwin, macos) (push) Has been skipped
Build and Release / Build Binaries (arm64, darwin, macos) (push) Has been skipped
Build and Release / Build Binary (linux/arm64) (push) Has been skipped
Build and Release / Integration Tests (PostgreSQL) (push) Successful in 4m12s
Action tokens have their access already validated earlier in the flow, so they should bypass the limited visibility repository check for clone/pull operations.
This commit is contained in:
@@ -221,7 +221,8 @@ func httpBase(ctx *context.Context) *serviceHandler {
|
||||
}
|
||||
|
||||
// Block clone/pull for limited visibility repos if user is not a collaborator
|
||||
if repo.IsLimited && isPull && !isWiki {
|
||||
// Skip this check for action tokens — their access was already validated above
|
||||
if repo.IsLimited && isPull && !isWiki && ctx.Data["IsActionsToken"] != true {
|
||||
allowed := ctx.Doer.IsAdmin || ctx.Doer.ID == repo.OwnerID
|
||||
if !allowed {
|
||||
if isCollab, _ := repo_model.IsCollaborator(ctx, repo.ID, ctx.Doer.ID); isCollab {
|
||||
|
||||
Reference in New Issue
Block a user