diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index fc20328..81fdcba 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: - node-version: [16.x] + node-version: [18.x,20.x] steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1d93bed..7074040 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,7 +15,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v1 with: - node-version: 16 + node-version: '18.x' - name: Install dependencies run: npm install - name: Build @@ -38,7 +38,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v1 with: - node-version: 16 + node-version: '18.x' - name: Install dependencies run: npm install - name: Download dist diff --git a/.github/workflows/sast-scan.yml b/.github/workflows/sast-scan.yml new file mode 100644 index 0000000..ed714ef --- /dev/null +++ b/.github/workflows/sast-scan.yml @@ -0,0 +1,11 @@ +name: SAST Scan +on: + pull_request: + types: [opened, synchronize, reopened] +jobs: + security: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Horusec Scan + run: docker run -v /var/run/docker.sock:/var/run/docker.sock -v $(pwd):/src horuszup/horusec-cli:latest horusec start -p /src -P $(pwd) diff --git a/.github/workflows/secrets-scan.yml b/.github/workflows/secrets-scan.yml new file mode 100644 index 0000000..0fc4fbb --- /dev/null +++ b/.github/workflows/secrets-scan.yml @@ -0,0 +1,11 @@ +name: Secrets Scan +on: + pull_request: + types: [opened, synchronize, reopened] +jobs: + security: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Gittyleaks + uses: gupy-io/gittyleaks-action@v0.1 diff --git a/package-lock.json b/package-lock.json index dc309e3..b0c7f6e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,16 +1,16 @@ { "name": "contentstack-cli-tsgen", - "version": "2.1.3", + "version": "2.1.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "contentstack-cli-tsgen", - "version": "2.1.3", + "version": "2.1.4", "license": "MIT", "dependencies": { - "@contentstack/cli-command": "^1.2.7", - "@contentstack/cli-utilities": "^1.4.3", + "@contentstack/cli-command": "^1.2.9", + "@contentstack/cli-utilities": "^1.4.5", "lodash": "^4.17.20", "prettier": "^2.0.5", "tslib": "^1.13.0" diff --git a/package.json b/package.json index f028be5..7bd1c71 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { "name": "contentstack-cli-tsgen", "description": "Generate TypeScript typings from a Stack.", - "version": "2.1.3", + "version": "2.1.4", "author": "Michael Davis", "bugs": "https://github.com/Contentstack-Solutions/contentstack-cli-tsgen/issues", "dependencies": { - "@contentstack/cli-command": "^1.2.7", - "@contentstack/cli-utilities": "^1.4.3", + "@contentstack/cli-command": "^1.2.9", + "@contentstack/cli-utilities": "^1.4.5", "lodash": "^4.17.20", "prettier": "^2.0.5", "tslib": "^1.13.0" diff --git a/src/lib/tsgen/factory.ts b/src/lib/tsgen/factory.ts index f452b6e..3e6a398 100644 --- a/src/lib/tsgen/factory.ts +++ b/src/lib/tsgen/factory.ts @@ -291,6 +291,8 @@ export default function (userOptions: TSGenOptions) { field.reference_to.forEach(v => { references.push(name_type(v)) }) + } else { + references.push(name_type(field.reference_to)) } return ['(', references.join(' | '), ')', '[]'].join('')