Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add workflow file for updating docs in website #258

Merged
merged 15 commits into from
Sep 16, 2024
8 changes: 4 additions & 4 deletions .github/workflows/update-docs-in-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
steps:
- name: Checkout Current repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: bindings
- name: Checkout Another repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: asyncapi/website
path: website
Expand All @@ -37,7 +37,7 @@ jobs:
uses: actions/github-script@v4
with:
script: |
const { writeFile } = require('fs').promises;
const { writeFile } = require('fs').promis;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why promis? should be promises

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing it out. Resolved it.

const configPath = './website/config/edit-page-config.json';
const checkSlug = 'reference/bindings/';
const slug = {
Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:
const newFullPath = path.join(folderPath, newFileName);
fs.renameSync(fullPath, newFullPath);

const newData = `---\ntitle: '${parentDirName.charAt(0).toUpperCase() + parentDirName.slice(1)}'\nweight: ${itemIndex}\n---\n\n`;
const newData = `---\ntitle: '${parentDirName}'\nweight: ${itemIndex}\n---\n\n`;
let existingFileData = fs.readFileSync(newFullPath, 'utf8');

existingFileData = existingFileData.replace(/<img\s+src="(?!http)(.*?)"/g, (match, src) => {
Expand Down
Loading