Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitba86a1b

Browse files
committed
v4.2.0 beta
- fixes for 550 folder issue- updated excludes option format
1 parent65c6a8f commitba86a1b

File tree

8 files changed

+2105
-2408
lines changed

8 files changed

+2105
-2408
lines changed

‎README.md‎

Lines changed: 38 additions & 26 deletions
Large diffs are not rendered by default.

‎dist/index.js‎

Lines changed: 1277 additions & 146 deletions
Large diffs are not rendered by default.

‎migration.md‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
#Migrating from v4.1.0 to v4.2.0
2+
3+
`v4.2.0` parses the`exclude` option in a more standard way.
4+
5+
Going forward the`exclude` option**must** be in the following format
6+
```yml
7+
exclude:|
8+
**/.git*
9+
**/.git*/**
10+
**/node_modules/**
11+
fileToExclude.txt
12+
```
13+
14+
---
15+
116
# Migrating from v3 to v4
217
318
Migrating from v3 to v4 should be fairly straightforward. Version 4 was designed with speed and ease of initial setup in mind. Going forward version 4 will be the only supported version.

‎package-lock.json‎

Lines changed: 756 additions & 2177 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name":"ftp-deploy-action",
3-
"version":"4.1.0",
3+
"version":"4.2.0",
44
"private":true,
55
"description":"Automate deploying websites and more with this GitHub action",
66
"main":"dist/index.js",
@@ -22,20 +22,20 @@
2222
"author":"Sam Kirkland",
2323
"license":"MIT",
2424
"dependencies": {
25-
"@actions/core":"^1.4.0",
26-
"@samkirkland/ftp-deploy":"^1.1.0",
27-
"@types/jest":"^26.0.23",
28-
"jest":"^27.0.5",
29-
"ts-jest":"^27.0.3",
30-
"ts-node-dev":"^1.1.6"
25+
"@actions/core":"^1.6.0",
26+
"@samkirkland/ftp-deploy":"^1.1.1",
27+
"@types/jest":"^27.0.2",
28+
"jest":"^27.2.5",
29+
"ts-jest":"^27.0.5",
30+
"ts-node-dev":"^1.1.8"
3131
},
3232
"devDependencies": {
3333
"@types/node":"^14.0.27",
3434
"@typescript-eslint/eslint-plugin":"^4.28.0",
35-
"@typescript-eslint/parser":"^4.28.0",
36-
"@vercel/ncc":"^0.28.6",
35+
"@typescript-eslint/parser":"^4.33.0",
36+
"@vercel/ncc":"^0.31.1",
3737
"eslint":"^7.29.0",
3838
"eslint-plugin-jest":"^24.3.6",
39-
"typescript":"^4.3.4"
39+
"typescript":"^4.4.3"
4040
}
4141
}

‎src/main.test.ts‎

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import{optionalBoolean,optionalInt,optionalLogLevel,optionalProtocol,optionalSecurity,optionalString,optionalStringArray}from"./parse";
1+
import{optionalBoolean,optionalInt,optionalLogLevel,optionalProtocol,optionalSecurity,optionalString}from"./parse";
22

33
describe("boolean",()=>{
44
test("false",()=>{
@@ -103,33 +103,3 @@ describe("security", () => {
103103
expect(optionalSecurity("test","strict")).toBe("strict");
104104
});
105105
});
106-
107-
describe("array",()=>{
108-
test("empty",()=>{
109-
expect(optionalStringArray("test","")).toEqual(undefined);
110-
});
111-
112-
test("empty array",()=>{
113-
expect(optionalStringArray("test","[]")).toEqual([]);
114-
});
115-
116-
test(`["test.txt"]`,()=>{
117-
expect(optionalStringArray("test","[test.txt]")).toEqual(["test.txt"]);
118-
});
119-
120-
test(`[ "test.txt" ]`,()=>{
121-
expect(optionalStringArray("test","[ test.txt ]")).toEqual(["test.txt"]);
122-
});
123-
124-
test(`["test.txt", "folder/**/*"]`,()=>{
125-
expect(optionalStringArray("test","[test.txt, folder/**/*]")).toEqual(["test.txt","folder/**/*"]);
126-
});
127-
128-
test(`["test.txt", "folder/**/*", "*other"]`,()=>{
129-
expect(optionalStringArray("test",`test.txt\n - folder/**/*\n - *other`)).toEqual(["test.txt","folder/**/*","*other"]);
130-
});
131-
132-
test(`["test.txt", "folder/**/*", "*other"]`,()=>{
133-
expect(optionalStringArray("test",`\n - test.txt\n - folder/**/*\n - *other`)).toEqual(["test.txt","folder/**/*","*other"]);
134-
});
135-
});

‎src/main.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ async function runDeployment() {
1616
"state-name":optionalString(core.getInput("state-name")),
1717
"dry-run":optionalBoolean("dry-run",core.getInput("dry-run")),
1818
"dangerous-clean-slate":optionalBoolean("dangerous-clean-slate",core.getInput("dangerous-clean-slate")),
19-
"exclude":optionalStringArray("exclude",core.getInput("exclude")),
19+
"exclude":optionalStringArray("exclude",core.getMultilineInput("exclude")),
2020
"log-level":optionalLogLevel("log-level",core.getInput("log-level")),
2121
"security":optionalSecurity("security",core.getInput("security"))
2222
};
2323

2424
awaitdeploy(args);
2525
}
26-
catch(error){
26+
catch(error:any){
2727
core.setFailed(error);
2828
}
2929
}

‎src/parse.ts‎

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -90,24 +90,14 @@ export function optionalInt(argumentName: string, rawValue: string): number | un
9090
thrownewError(`${argumentName}: invalid parameter - you provided "${rawValue}". Try a whole number (no decimals) instead like 1234`);
9191
}
9292

93-
exportfunctionoptionalStringArray(argumentName:string,rawValue:string):string[]|undefined{
94-
if(rawValue.length===0){
95-
returnundefined;
96-
}
97-
98-
constvalueTrim=rawValue.trim();
99-
100-
if(valueTrim.startsWith("[")){
101-
// remove [ and ] - then convert to array
102-
returnrawValue.replace(/[\[\]]/g,"").trim().split(", ").filter(str=>str!=="");
93+
exportfunctionoptionalStringArray(argumentName:string,rawValue:string[]):string[]|undefined{
94+
if(typeofrawValue==="string"){
95+
thrownewError(`${argumentName}: invalid parameter - you provided "${rawValue}". This option expects an list in the EXACT format described in the readme`);
10396
}
10497

105-
// split value by space and comma
106-
constvalueAsArrayDouble=rawValue.split(" - ").map(str=>str.trim()).filter(str=>str!=="");
107-
108-
if(valueAsArrayDouble.length){
109-
returnvalueAsArrayDouble;
98+
if(rawValue.length===0){
99+
returnundefined;
110100
}
111101

112-
thrownewError(`${argumentName}: invalid parameter - you provided "${rawValue}". This option excepts an array in the format [val1, val2] or val1\/n - val2`);
102+
returnrawValue;
113103
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp