From d5d68f3936263693a7998bc8fff732886f0e35cb Mon Sep 17 00:00:00 2001 From: Beth Brennan Date: Wed, 15 Feb 2023 15:25:25 -0500 Subject: [PATCH] Serialize NullToken as null --- actions-workflow-parser/src/templates/tokens/null-token.ts | 2 +- actions-workflow-parser/src/templates/tokens/serialization.ts | 1 + .../testdata/reader/reusable-workflow-job-basic.yml | 1 - .../reusable-workflow-secrets-secret-without-definition.yml | 1 - actions-workflow-parser/testdata/reader/yaml-schema-null.yml | 2 -- 5 files changed, 2 insertions(+), 5 deletions(-) diff --git a/actions-workflow-parser/src/templates/tokens/null-token.ts b/actions-workflow-parser/src/templates/tokens/null-token.ts index 5474c10..11fabda 100644 --- a/actions-workflow-parser/src/templates/tokens/null-token.ts +++ b/actions-workflow-parser/src/templates/tokens/null-token.ts @@ -23,6 +23,6 @@ export class NullToken extends LiteralToken { } public override toJSON() { - return "null"; + return null; } } diff --git a/actions-workflow-parser/src/templates/tokens/serialization.ts b/actions-workflow-parser/src/templates/tokens/serialization.ts index 5dd6f9d..3e10bbf 100644 --- a/actions-workflow-parser/src/templates/tokens/serialization.ts +++ b/actions-workflow-parser/src/templates/tokens/serialization.ts @@ -29,4 +29,5 @@ export type SerializedToken = | string | number | boolean + | null | undefined; diff --git a/actions-workflow-parser/testdata/reader/reusable-workflow-job-basic.yml b/actions-workflow-parser/testdata/reader/reusable-workflow-job-basic.yml index 9d9c070..37fd6ee 100644 --- a/actions-workflow-parser/testdata/reader/reusable-workflow-job-basic.yml +++ b/actions-workflow-parser/testdata/reader/reusable-workflow-job-basic.yml @@ -1,7 +1,6 @@ include-source: false # Drop file/line/col from output skip: - Go - - TypeScript --- on: push jobs: diff --git a/actions-workflow-parser/testdata/reader/reusable-workflow-secrets-secret-without-definition.yml b/actions-workflow-parser/testdata/reader/reusable-workflow-secrets-secret-without-definition.yml index 2c8e078..664f4fc 100644 --- a/actions-workflow-parser/testdata/reader/reusable-workflow-secrets-secret-without-definition.yml +++ b/actions-workflow-parser/testdata/reader/reusable-workflow-secrets-secret-without-definition.yml @@ -1,7 +1,6 @@ include-source: false # Drop file/line/col from output skip: - Go - - TypeScript --- on: push jobs: diff --git a/actions-workflow-parser/testdata/reader/yaml-schema-null.yml b/actions-workflow-parser/testdata/reader/yaml-schema-null.yml index 6349637..0e73a48 100644 --- a/actions-workflow-parser/testdata/reader/yaml-schema-null.yml +++ b/actions-workflow-parser/testdata/reader/yaml-schema-null.yml @@ -1,6 +1,4 @@ include-source: false # Drop file/line/col from output -skip: - - TypeScript --- on: push jobs: