diff --git a/tekton/ci-lint-run.yaml b/tekton/ci-lint-run.yaml new file mode 100644 index 00000000000..37f57dfd460 --- /dev/null +++ b/tekton/ci-lint-run.yaml @@ -0,0 +1,28 @@ +apiVersion: tekton.dev/v1alpha1 +kind: PipelineResource +metadata: + name: tekton-pipelines +spec: + type: git + params: + - name: url + value: https://github.com/tektoncd/pipeline # REPLACE with your own fork + - name: revision + value: master # REPLACE with your own commit +--- +apiVersion: tekton.dev/v1alpha1 +kind: TaskRun +metadata: + name: golangci-lint-run +spec: + taskRef: + name: golangci-lint + inputs: + params: + - name: flags + value: --verbose + resources: + - name: source + resourceRef: + name: tekton-pipelines + diff --git a/tekton/ci-lint.yaml b/tekton/ci-lint.yaml new file mode 100644 index 00000000000..76d214e2952 --- /dev/null +++ b/tekton/ci-lint.yaml @@ -0,0 +1,32 @@ +apiVersion: tekton.dev/v1alpha1 +kind: Task +metadata: + name: golangci-lint +spec: + inputs: + params: + - name: package + description: package (and its children) under test + default: github.com/tektoncd/pipeline + - name: flags + description: flags to use for the test command + - name: version + description: golangci-lint version to use + default: v1.16 + resources: + - name: source + type: git + targetPath: src/${inputs.params.package} + steps: + - name: lint + image: golangci/golangci-lint:${inputs.params.version} + workingdir: /workspace/src/${inputs.params.package} + command: + - /bin/bash + args: + - -c + - "golangci-lint run ${inputs.params.flags}" + env: + - name: GOPATH + value: /workspace +