From 262ab77700be3acec7e7a2db1c59a703fb873331 Mon Sep 17 00:00:00 2001 From: Alex Patterson Date: Mon, 18 Dec 2023 01:18:53 -0500 Subject: [PATCH] update message for commit --- .github/workflows/syndicate.yml | 2 +- apps/codingcatdev/scripts/dev-to.js | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/syndicate.yml b/.github/workflows/syndicate.yml index 60ab9d7f..e5757d87 100644 --- a/.github/workflows/syndicate.yml +++ b/.github/workflows/syndicate.yml @@ -40,4 +40,4 @@ jobs: PRIVATE_DEVTO: ${{ secrets.PRIVATE_DEVTO }} - uses: stefanzweifel/git-auto-commit-action@v4 with: - commit_message: Shrink images \ No newline at end of file + commit_message: devto updated \ No newline at end of file diff --git a/apps/codingcatdev/scripts/dev-to.js b/apps/codingcatdev/scripts/dev-to.js index 133311d3..cfc7c075 100644 --- a/apps/codingcatdev/scripts/dev-to.js +++ b/apps/codingcatdev/scripts/dev-to.js @@ -56,13 +56,14 @@ for await (const file of g) { // Get new devto url and update if (response.status === 201) { - const { url } = response.json(); - if (url) { + const json = await response.json(); + console.log('data from devto', json); + if (json?.url) { + console.log('Updating', file, { devto: json.url }); const newMdFile = matter.stringify(content, { ...data, - devto: url + devto: json.url }); - console.log('Updating', file, { devto: url }); fs.writeFileSync(file, newMdFile, { encoding: 'utf8', flag: 'r' }); } }