From c6d3c978ce02c51be76736b72c8bfa85178d5816 Mon Sep 17 00:00:00 2001 From: gentlementlegen Date: Wed, 2 Oct 2024 12:57:44 +0900 Subject: [PATCH] chore: test all in actions --- .github/workflows/validate-schema.yml | 28 +++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/.github/workflows/validate-schema.yml b/.github/workflows/validate-schema.yml index 48b9adb..575677c 100644 --- a/.github/workflows/validate-schema.yml +++ b/.github/workflows/validate-schema.yml @@ -21,7 +21,31 @@ jobs: - name: Install deps and run configuration update run: | yarn install --immutable --immutable-cache --check-cache - yarn tsx src/update-configuration.ts + + - name: Update manifest configuration using GitHub Script + uses: actions/github-script@v7 + with: + script: | + const fs = require('fs'); + const path = require('path'); + + // Load the plugin settings schema from the types file + const { pluginSettingsSchema } = require('./src/types'); + + // Read and parse the manifest file + const manifestPath = path.resolve(__dirname, './manifest.json'); + const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8')); + + // Stringify the plugin settings schema and add it to the manifest + const configuration = JSON.stringify(pluginSettingsSchema); + console.log('Updated configuration:', configuration); + + // Add or update the configuration key in the manifest + manifest["configuration"] = JSON.parse(configuration); + + // Write the updated manifest back to the file + fs.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2)); + console.log('Manifest updated successfully'); - name: Commit and Push generated types run: | @@ -35,4 +59,4 @@ jobs: echo "No changes to commit" fi env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}