Skip to content

Commit cfdb32a

Browse files
qwerty2876543
andauthored
Fully support .yaml (#1713)
Follow-up to #1388 Closes #1073 --------- Co-authored-by: 6543 <6543@obermui.de>
1 parent 2dd1b4f commit cfdb32a

5 files changed

Lines changed: 8 additions & 8 deletions

File tree

cli/exec/exec.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ import (
4545
var Command = &cli.Command{
4646
Name: "exec",
4747
Usage: "execute a local pipeline",
48-
ArgsUsage: "[path/to/.woodpecker.yml]",
48+
ArgsUsage: "[path/to/.woodpecker.yaml]",
4949
Action: run,
5050
Flags: append(common.GlobalFlags, flags...),
5151
}
@@ -66,7 +66,7 @@ func execDir(c *cli.Context, dir string) error {
6666
}
6767

6868
// check if it is a regular file (not dir)
69-
if info.Mode().IsRegular() && strings.HasSuffix(info.Name(), ".yml") {
69+
if info.Mode().IsRegular() && (strings.HasSuffix(info.Name(), ".yaml") || strings.HasSuffix(info.Name(), ".yml")) {
7070
fmt.Println("#", info.Name())
7171
_ = runExec(c, path, repoPath) // TODO: should we drop errors or store them and report back?
7272
fmt.Println("")

cli/lint/lint.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
var Command = &cli.Command{
1717
Name: "lint",
1818
Usage: "lint a pipeline configuration file",
19-
ArgsUsage: "[path/to/.woodpecker.yml]",
19+
ArgsUsage: "[path/to/.woodpecker.yaml]",
2020
Action: lint,
2121
Flags: common.GlobalFlags,
2222
}
@@ -33,7 +33,7 @@ func lintDir(c *cli.Context, dir string) error {
3333
}
3434

3535
// check if it is a regular file (not dir)
36-
if info.Mode().IsRegular() && strings.HasSuffix(info.Name(), ".yml") {
36+
if info.Mode().IsRegular() && (strings.HasSuffix(info.Name(), ".yaml") || strings.HasSuffix(info.Name(), ".yml")) {
3737
fmt.Println("#", info.Name())
3838
if err := lintFile(c, path); err != nil {
3939
errorStrings = append(errorStrings, err.Error())

server/forge/configFetcher_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ func TestFetch(t *testing.T) {
114114
expectedError: false,
115115
},
116116
{
117-
name: "Default config check .woodpecker.yml before .woodpecker.yaml",
117+
name: "Default config check .woodpecker.yaml before .woodpecker.yml",
118118
repoConfig: "",
119119
files: []file{{
120120
name: ".woodpecker.yaml",
@@ -124,7 +124,7 @@ func TestFetch(t *testing.T) {
124124
data: dummyData,
125125
}},
126126
expectedFileNames: []string{
127-
".woodpecker.yml",
127+
".woodpecker.yaml",
128128
},
129129
expectedError: false,
130130
},

shared/constant/constant.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ var PrivilegedPlugins = []string{
2626
// folders are indicated by supplying a trailing /
2727
var DefaultConfigOrder = [...]string{
2828
".woodpecker/",
29-
".woodpecker.yml",
3029
".woodpecker.yaml",
30+
".woodpecker.yml",
3131
".drone.yml",
3232
}
3333

web/src/assets/locales/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
"success": "Repository settings updated",
8282
"pipeline_path": {
8383
"path": "Pipeline path",
84-
"default": "By default: .woodpecker/*.yml -> .woodpecker.yml -> .drone.yml",
84+
"default": "By default: .woodpecker/*.{'{yaml,yml}'} -> .woodpecker.yaml -> .woodpecker.yml -> .drone.yml",
8585
"desc": "Path to your pipeline config (for example {0}). Folders should end with a {1}.",
8686
"desc_path_example": "my/path/"
8787
},

0 commit comments

Comments
 (0)