diff --git a/.github/ci.el b/.github/ci.el index d8ba11bf2..ce92f90cc 100644 --- a/.github/ci.el +++ b/.github/ci.el @@ -11,12 +11,14 @@ (add-to-list 'doom-cli-commit-scopes "cli") (add-to-list 'doom-cli-commit-scopes "lib") (add-to-list 'doom-cli-commit-scopes "docs") -(add-to-list 'doom-cli-commit-scopes #'ci-module-scope) -(add-to-list 'doom-cli-commit-scopes #'ci-docs-scope) +(add-to-list 'doom-cli-commit-scopes '(docs "install" ci-check-docs-scope)) +(add-to-list 'doom-cli-commit-scopes #'ci-check-module-scope) +;; DEPRECATED Will be removed once modules live in their own repo +(add-to-list 'doom-cli-commit-scopes '(release "modules")) ;;; Helpers -(cl-defun ci-module-scope (scope (&key type)) +(cl-defun ci-check-module-scope (scope (&key type &allow-other-keys)) "Only allow :CATEGORY or MODULE scopes if they actually exist." (seq-find (doom-rpartial #'doom-glob (if (string-prefix-p ":" scope) @@ -25,12 +27,11 @@ (list (doom-dir (dir!) "../modules/") (doom-dir doom-private-dir "modules/")))) -(cl-defun ci-docs-scope (scope (&key type)) +(defun ci-check-docs-scope (scope _) "Allow any filename in docs/* as a scope for docs commits." - (when (eq type 'docs) - (member scope - (cons "install" - (mapcar #'file-name-base - (doom-glob (dir!) "../docs/*.org")))))) + (member + scope (doom-files-in (doom-path (dir!) "../docs") + :match "\\.org$" + :map #'file-name-base))) ;;; ci.el ends here