diff --git a/.github/actions/build-validate-artifact/action.yml b/.github/actions/build-validate-artifact/action.yml index 798fdc4492..ea0596d44e 100644 --- a/.github/actions/build-validate-artifact/action.yml +++ b/.github/actions/build-validate-artifact/action.yml @@ -4,14 +4,21 @@ inputs: output-artifact: description: 'If provided, the action will output the artifact to the build directory' required: false + runs: using: composite steps: + - name: Add data source ids to schema + shell: bash + run: | + cd utils && yarn add-datasource-ids + - name: Build & Validate Artifact shell: bash id: build-validate-artifact run: | cd utils && yarn build-validate-quickstart-artifact ${{ inputs.output-artifact && '--output-artifact' || '' }} + - name: Debugging output shell: bash if: ${{ runner.debug }} diff --git a/utils/schema/add-datasource-ids.ts b/utils/schema/add-datasource-ids.ts index 697d4c8d9a..83f67ac0c8 100644 --- a/utils/schema/add-datasource-ids.ts +++ b/utils/schema/add-datasource-ids.ts @@ -10,7 +10,7 @@ const CORE_DATASOURCE_IDS_PATH = './core-datasource-ids.json'; const DATASOURCE_BASE_PATH = '../../'; type ArtifactSchema = { - properties: { + definitions: { dataSourceIds: { enum: string[]; }; @@ -50,8 +50,8 @@ const updateSchema = ( ): ArtifactSchema => { return { ...schema, - properties: { - ...schema.properties, + definitions: { + ...schema.definitions, dataSourceIds: { enum: ids }, }, }; diff --git a/utils/schema/artifact.json b/utils/schema/artifact.json index e65cfcb9e3..0b36de8fd6 100644 --- a/utils/schema/artifact.json +++ b/utils/schema/artifact.json @@ -20,7 +20,8 @@ "items": { "$ref": "#/definitions/dashboard" } }, "dataSourceIds": { - "type": "array", "items": { "type": "string" } + "type": "array", + "items": { "$ref": "#/definitions/dataSourceIds" } } }, "required": [ @@ -41,7 +42,8 @@ "summary": { "type": "string" }, "title": { "type": "string" }, "authors": { - "type": "array", "items": { "type": "string" } + "type": "array", + "items": { "type": "string" } }, "documentation": { "type": "array", @@ -59,17 +61,21 @@ "level": { "enum": ["New Relic", "Community", "Verified"] }, "icon": { "type": "string" }, "keywords": { - "type": "array", "items": { "type": "string" } + "type": "array", + "items": { "type": "string" } }, "slug": { "type": "string" }, "alertPolicies": { - "type": "array", "items": { "type": "string" } + "type": "array", + "items": { "type": "string" } }, "dashboards": { - "type": "array", "items": { "type": "string" } + "type": "array", + "items": { "type": "string" } }, "dataSourceIds": { - "type": "array", "items": { "type": "string" } + "type": "array", + "items": { "$ref": "#/definitions/dataSourceIds" } } }, "required": [