feat: support single package repository
All checks were successful
Pre-commit / pre-commit (pull_request) Successful in 7m49s
Update alr-git / changelog (push) Successful in 31s

This commit is contained in:
2025-06-14 22:26:33 +03:00
parent 1ca7801fba
commit d1fe02fa57
4 changed files with 143 additions and 42 deletions

View File

@ -20,11 +20,9 @@ import (
"context"
"fmt"
"io"
"path/filepath"
"github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5/plumbing"
"github.com/go-git/go-git/v5/plumbing/format/diff"
"github.com/go-git/go-git/v5/plumbing/transport"
"github.com/go-git/go-git/v5/plumbing/transport/client"
@ -36,22 +34,6 @@ import (
"gitea.plemya-x.ru/Plemya-x/ALR/pkg/types"
)
// isValid makes sure the path of the file being updated is valid.
// It checks to make sure the file is not within a nested directory
// and that it is called alr.sh.
func isValid(from, to diff.File) bool {
var path string
if from != nil {
path = from.Path()
}
if to != nil {
path = to.Path()
}
match, _ := filepath.Match("*/*.sh", path)
return match
}
func parseScript(
ctx context.Context,
repo types.Repo,