Skip to content

Commit

Permalink
chore: changed config generation
Browse files Browse the repository at this point in the history
  • Loading branch information
gentlementlegen committed Oct 2, 2024
1 parent 7626ddb commit d202b75
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions .github/workflows/update-configuration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,23 @@ jobs:
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const path = require('path');
import { promises as fs } from 'fs';
import path from 'path';
const { pluginSettingsSchema } = require('./src/types/plugin-inputs.js');
import { pluginSettingsSchema } from './dist/types.js'; // Ensure the `.js` extension is included
const manifestPath = path.resolve("${{ github.workspace }}", './manifest.json');
const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8'));
(async () => {
const manifestPath = path.resolve("${{ github.workspace }}", './manifest.json');
const manifest = JSON.parse(await fs.readFile(manifestPath, 'utf8'));
const configuration = JSON.stringify(pluginSettingsSchema);
const configuration = JSON.stringify(pluginSettingsSchema);
manifest["configuration"] = JSON.parse(configuration);
manifest["configuration"] = JSON.parse(configuration);
const updatedManifest = JSON.stringify(manifest, null, 2)
console.log('Updated manifest:', updatedManifest);
fs.writeFileSync(manifestPath, updatedManifest);
const updatedManifest = JSON.stringify(manifest, null, 2);
console.log('Updated manifest:', updatedManifest);
await fs.writeFile(manifestPath, updatedManifest);
})();
- name: Commit and Push generated types
run: |
Expand Down

0 comments on commit d202b75

Please sign in to comment.