Skip to content

Commit

Permalink
fix: add script for edit-page-config
Browse files Browse the repository at this point in the history
  • Loading branch information
AnimeshKumar923 committed Mar 7, 2024
1 parent 34f07ff commit 8ad48e3
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/update-docs-in-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,24 @@ jobs:
working-directory: ./website
run: |
git checkout -b update-community-docs-${{ github.sha }}
- name: Update edit-page-config.json
uses: actions/github-script@v4
with:
script: |
const { writeFile } = require('fs').promises;
const configPath = './website/config/edit-page-config.json';
const checkSlug = 'reference/extensions/';
const slug = {
"value": checkSlug,
"href": "https://github.com/asyncapi/community/tree/master/docs"
};
const configData = require(configPath);
const entryExists = configData.some(entry => entry.value === checkSlug);
if (!entryExists) {
configData.push(slug);
await writeFile(configPath, JSON.stringify(configData, null, 2))
}
- name: Copy community folder from Current Repo to Another
working-directory: ./website
run: |
Expand Down

0 comments on commit 8ad48e3

Please sign in to comment.