-
Notifications
You must be signed in to change notification settings - Fork 0
/
step.yaml
59 lines (59 loc) · 1.87 KB
/
step.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
version: "1.0"
kind: step-type
metadata:
name: rothandrew/pre-commit
version: 0.0.3
isPublic: true
stage: incubating
description: |
Runs "pre-commit run -a" to validate that all pre-commit git hooks are passing. https://pre-commit.com/.
Uses Dad's Garage as the runtime container. https://github.com/dadsgarage/dadsgarage.
Submit issues in either the step repo or the Dad's Garage repo if you have problems.
sources:
- "https://github.com/RothAndrew/cf-step-pre-commit"
maintainers:
- name: Andrew Roth
categories:
- git
- validate
official: false
tags:
- pre-commit
examples:
- description: example-1
workflow:
pre_commit:
type: rothandrew/pre-commit
title: Validating pre-commit hooks
stage: Validate
arguments:
working_directory: "/codefresh/volume/${{CF_REPO_NAME}}"
spec:
arguments: |
{
"definitions": {},
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"additionalProperties": false,
"patterns": [],
"required": [],
"properties": {
"working_directory": {
"type": "string",
"description": "The directory in which the pre-commit command is executed. It can be an explicit path in the container’s file system, or a variable that references another step. The default is /codefresh/volume/${{CF_REPO_NAME}}",
"examples": ["/codefresh/volume/${{CF_REPO_NAME}}/foo"],
"default": "/codefresh/volume/${{CF_REPO_NAME}}"
}
}
}
steps:
main:
name: pre-commit
image: dadsgarage/dadsgarage:0.3.5
environment:
- "PRE_COMMIT_HOME=/codefresh/volume/pre-commit-cache"
- "WORKING_DIRECTORY=${{working_directory}}"
commands:
- cd ${WORKING_DIRECTORY}
- pre-commit install
- pre-commit run -a