Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to node20 #26

Merged
merged 2 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/check-dist.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set Node.js 16.x
uses: actions/setup-node@v3.5.1
- name: Set Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 16.x
node-version: 20.x

- name: Install dependencies
run: yarn
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/check-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set Node.js 16.x
uses: actions/setup-node@v3.5.1
- name: Set Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 16.x
node-version: 20.x

- name: Install dependencies
run: yarn
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ jobs:

strategy:
matrix:
node-version: [16.x]
node-version: [20.x]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: docker compose up -d
Expand All @@ -31,12 +31,12 @@ jobs:

strategy:
matrix:
node-version: [16.x]
node-version: [20.x]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: docker compose up -d
Expand All @@ -46,7 +46,7 @@ jobs:
test-e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: docker compose up -d
env:
PUBLIC_KEY: ${{secrets.PUBLIC_KEY}}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-latest-tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@master
uses: actions/checkout@v4

- name: Run latest-tag
uses: EndBug/[email protected]
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ This action uploads files to a remote server using the SFTP protocol. Unlike oth
### Upload everything with password

```yaml
uses: actions/checkout@v3
uses: actions/checkout@v4
uses: Dylan700/sftp-upload-action@latest
with:
server: sftp.server.com
Expand All @@ -52,7 +52,7 @@ with:
### Upload everything with password, ignoring .git

```yaml
uses: actions/checkout@v3
uses: actions/checkout@v4
uses: Dylan700/sftp-upload-action@latest
with:
server: sftp.server.com
Expand All @@ -69,7 +69,7 @@ with:
### Upload multiple folders with private key

```yaml
uses: actions/checkout@v3
uses: actions/checkout@v4
uses: Dylan700/sftp-upload-action@latest
with:
server: sftp.server.com
Expand All @@ -85,7 +85,7 @@ with:
### Upload multiples folders and delete existing files in those folders

```yaml
uses: actions/checkout@v3
uses: actions/checkout@v4
uses: Dylan700/sftp-upload-action@latest
with:
server: sftp.server.com
Expand All @@ -104,7 +104,7 @@ with:
Specific files can be uploaded be negating the `ignore` inputs with an exclamation `!` character. The example below will only upload files that have a name matching `index.html` or `.htaccess`.

```yaml
uses: actions/checkout@v3
uses: actions/checkout@v4
uses: Dylan700/sftp-upload-action@latest
with:
server: sftp.server.com
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ inputs:
required: false
default: 'false'
runs:
using: 'node16'
using: 'node20'
main: 'dist/index.js'
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { debug, getBooleanInput, getInput, setFailed, warning } from "@actions/core"
import * as Client from "ssh2-sftp-client"
import Upload from "./types/Upload"
import minimatch, { MinimatchOptions } from "minimatch"
import minimatch from "minimatch"
import pLimit from "p-limit"
import * as fs from "fs"

const minimatch_options: MinimatchOptions = {
const minimatch_options = {
dot: true,
matchBase: true
}
Expand Down Expand Up @@ -51,7 +51,7 @@
try{
await sftp.rmdir(dir, true)
debug(`${dir} has been deleted.`)
}catch(e: any){

Check warning on line 54 in src/main.ts

View workflow job for this annotation

GitHub Actions / check-lint

Unexpected any. Specify a different type
warning(`Unable to delete existing files for ${dir} before upload. ${e}`)
}
}
Expand Down Expand Up @@ -130,7 +130,7 @@
await sftp.end()
debug("Session ended.")

} catch (error: any) {

Check warning on line 133 in src/main.ts

View workflow job for this annotation

GitHub Actions / check-lint

Unexpected any. Specify a different type
setFailed(error.message)
}
}
Expand Down
6 changes: 3 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */

/* Language and Environment */
"target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
"target": "es2022", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
// "jsx": "preserve", /* Specify what JSX code is generated. */
// "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
Expand All @@ -27,9 +27,9 @@
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */

/* Modules */
"module": "commonjs", /* Specify what module code is generated. */
"module": "Node16", /* Specify what module code is generated. */
"rootDir": "./src", /* Specify the root folder within your source files. */
// "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
"moduleResolution": "Node16", /* Specify how TypeScript looks up a file from a given module specifier. */
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
Expand Down
Loading