ci: устойчивый карантин зависимостей (grep под set -e)
grep -v без совпадений возвращает 1; в sh -e это роняло шаг. Добавлен || true.
This commit is contained in:
@@ -47,7 +47,8 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
direct=$(go list -m -f '{{if not .Main}}{{if not .Indirect}}{{.Path}}{{end}}{{end}}' all)
|
direct=$(go list -m -f '{{if not .Main}}{{if not .Indirect}}{{.Path}}{{end}}{{end}}' all)
|
||||||
allowed='^(github.com/modelcontextprotocol/go-sdk|gopkg.in/yaml.v3|github.com/BurntSushi/toml)$'
|
allowed='^(github.com/modelcontextprotocol/go-sdk|gopkg.in/yaml.v3|github.com/BurntSushi/toml)$'
|
||||||
bad=$(echo "$direct" | grep -vE "$allowed" | grep -v '^$')
|
bad=$(echo "$direct" | grep -vE "$allowed" | grep -v '^$' || true)
|
||||||
if [ -n "$bad" ]; then
|
if [ -n "$bad" ]; then
|
||||||
echo "недопустимые прямые зависимости:"; echo "$bad"; exit 1
|
echo "недопустимые прямые зависимости:"; echo "$bad"; exit 1
|
||||||
fi
|
fi
|
||||||
|
echo "toolkit-deps: ok"
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ tidy-check:
|
|||||||
toolkit-deps:
|
toolkit-deps:
|
||||||
@direct=$$($(GO) list -m -f '{{if not .Main}}{{if not .Indirect}}{{.Path}}{{end}}{{end}}' all); \
|
@direct=$$($(GO) list -m -f '{{if not .Main}}{{if not .Indirect}}{{.Path}}{{end}}{{end}}' all); \
|
||||||
allowed='^(github.com/modelcontextprotocol/go-sdk|gopkg.in/yaml.v3|github.com/BurntSushi/toml)$$'; \
|
allowed='^(github.com/modelcontextprotocol/go-sdk|gopkg.in/yaml.v3|github.com/BurntSushi/toml)$$'; \
|
||||||
bad=$$(echo "$$direct" | grep -vE "$$allowed" | grep -v '^$$'); \
|
bad=$$(echo "$$direct" | grep -vE "$$allowed" | grep -v '^$$' || true); \
|
||||||
if [ -n "$$bad" ]; then \
|
if [ -n "$$bad" ]; then \
|
||||||
echo "недопустимые прямые зависимости (разрешены только go-sdk/yaml/toml):"; \
|
echo "недопустимые прямые зависимости (разрешены только go-sdk/yaml/toml):"; \
|
||||||
echo "$$bad"; exit 1; \
|
echo "$$bad"; exit 1; \
|
||||||
|
|||||||
Reference in New Issue
Block a user