diff --git a/docs/changelog.lisp b/docs/changelog.lisp index 5716506..5d13f77 100644 --- a/docs/changelog.lisp +++ b/docs/changelog.lisp @@ -17,12 +17,14 @@ New === * Now you can specify ENV argument to 40ANTS-CI:DEFWORKFLOW and any job. This should be an alist where keys are strings and values are evaluated during GitHub workflow generation phase. Read more in 40ANTS-CI-DOCS/INDEX::@ENV section. +* 40ANTS-CI/JOBS/AUTOTAG:AUTOTAG function now ignores TOKEN-PATTERN argument if ENV argument was given and has GITHUB_TOKEN value for whole job. Backward incompatible changes ============================= * When additional keyword arguments to 40ANTS-CI/STEPS/SH:SH function are given, they are transformed into env variables. Previously, their names were taken as is. Now they are uppercased and dash symbols are replaced with underscores. + ") (0.14.0 2024-02-25 " diff --git a/src/jobs/autotag.lisp b/src/jobs/autotag.lisp index 1652d55..0218870 100644 --- a/src/jobs/autotag.lisp +++ b/src/jobs/autotag.lisp @@ -1,6 +1,7 @@ (uiop:define-package #:40ants-ci/jobs/autotag (:use #:cl) - (:import-from #:40ants-ci/jobs/job) + (:import-from #:40ants-ci/jobs/job + #:job-env) (:import-from #:40ants-ci/steps/action #:action) (:export #:autotag @@ -48,13 +49,15 @@ (defun autotag (&key (filename *default-filename*) (regex *default-regex*) (tag-prefix *default-tag-prefix*) - (token-pattern *default-token-pattern*)) + (token-pattern *default-token-pattern*) + env) "Creates a job which will run autotagger to create a new git tag for release." (make-instance 'autotag :filename filename :regex regex :tag-prefix tag-prefix - :token-pattern token-pattern)) + :token-pattern token-pattern + :env env)) (defmethod 40ants-ci/jobs/job:steps ((job autotag)) @@ -67,6 +70,8 @@ :root (filename job) :regex_pattern (regex job) :tag_prefix (tag-prefix job) - :env (list :github_token - (token-pattern job)))) + :env (unless (assoc "GITHUB_TOKEN" (job-env job) + :test #'string=) + (list :github_token + (token-pattern job))))) (call-next-method))) diff --git a/src/jobs/critic.lisp b/src/jobs/critic.lisp index 091d75f..1ec746f 100644 --- a/src/jobs/critic.lisp +++ b/src/jobs/critic.lisp @@ -21,7 +21,7 @@ :reader ignore-critiques))) -(defun critic (&key asdf-systems asdf-version ignore-critiques) +(defun critic (&key asdf-systems asdf-version ignore-critiques env) "Creates a job which will run Lisp Critic for given ASDF systems. If argument ASDF-SYSTEMS is NIL, it will use ASDF system @@ -36,7 +36,8 @@ :asdf-system (first asdf-systems) :asdf-systems asdf-systems :asdf-version asdf-version - :ignore-critiques ignore-critiques))) + :ignore-critiques ignore-critiques + :env env))) (defmethod 40ants-ci/jobs/job:steps ((job critic)) diff --git a/src/jobs/docs.lisp b/src/jobs/docs.lisp index ff0a930..6eababc 100644 --- a/src/jobs/docs.lisp +++ b/src/jobs/docs.lisp @@ -19,14 +19,16 @@ (:documentation "Builds documentation and uploads it to GitHub using [\"40ants/build-docs\" github action](https://40ants.com/build-docs/).")) -;; (defun build-docs (&key asdf-system -;; asdf-version -;; (error-on-warnings t)) -;; "Creates a job of class BUILD-DOCS." -;; (make-instance 'build-docs -;; :asdf-system asdf-system -;; :error-on-warnings error-on-warnings -;; :asdf-version asdf-version)) +(defun build-docs (&key asdf-system + asdf-version + (error-on-warnings t) + env) + "Creates a job of class BUILD-DOCS." + (make-instance 'build-docs + :asdf-system asdf-system + :error-on-warnings error-on-warnings + :asdf-version asdf-version + :env env)) (defmethod 40ants-ci/jobs/job:steps ((job build-docs)) diff --git a/src/jobs/run-tests.lisp b/src/jobs/run-tests.lisp index 6564692..9e0131e 100644 --- a/src/jobs/run-tests.lisp +++ b/src/jobs/run-tests.lisp @@ -34,10 +34,12 @@ quicklisp lisp exclude - custom) + custom + env) "Creates a job step of class RUN-TESTS." (declare (ignore coverage qlfile os quicklisp lisp - asdf-system asdf-version exclude)) + asdf-system asdf-version exclude + env)) (check-type custom (or null string list)) (apply #'make-instance 'run-tests diff --git a/src/workflow.lisp b/src/workflow.lisp index 2638e34..762557c 100644 --- a/src/workflow.lisp +++ b/src/workflow.lisp @@ -96,7 +96,9 @@ - (foo 1 2 3) -> result of foo call. " (if (and (listp arg) - (not (symbolp (first arg)))) + (or (not (symbolp (first arg))) + ;; We don't want to eval plists + (keywordp (first arg)))) arg (eval arg)))