Skip to content

Commit

Permalink
feat(*): final adjusts to publish to devTo
Browse files Browse the repository at this point in the history
  • Loading branch information
trystan2k committed Oct 21, 2024
1 parent a901bad commit cf56142
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 14 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
uses: ./ # Uses an action in the root directory
id: publish-blog-post
with:
publishTo: 'devTo'
devToApiKey: ${{ secrets.DEV_TO_API_KEY }}
includeFolders: |-
pages/posts
test/post-samples
commitMessage: 'chore(*): publish/update %file with updated data'
2 changes: 1 addition & 1 deletion .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pnpm test
pnpm test:all
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ inputs:
publishTo:
description: Websites to publish blog post. Current allowed values are 'devTo' and 'medium'
required: true
default: 'devTo,medium'
default: 'devTo'
devToApiKey:
description: API Key to use to publish blog post to Dev.to website
required: false
Expand Down
7 changes: 4 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38218,13 +38218,14 @@ const main = async () => {
await gitSetConfig();
const branch = await gitCheckout();
const commitMessage = getCommitMessage(ACTION_INPUT_KEY_COMMIT_MESSAGE_TEMPLATE);
modifiedFiles.forEach(async (fileName) => {
for (const fileName of modifiedFiles) {
await gitCommit({
filePath: fileName,
message: commitMessage.replace('%file', fileName),
});
});
gitPush({ branch });
}
await gitPush({ branch });
logBuildInfo('Build completed successfully.');
};
main().catch(setBuildFailed);
/* harmony default export */ const src = (main);
Expand Down
9 changes: 6 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
gitCommit,
gitPush,
gitSetConfig,
logBuildInfo,
setBuildFailed,
} from '@/pbp/git';
import { parsePostFileContent } from '@/pbp/posts/content';
Expand All @@ -32,14 +33,16 @@ const main = async () => {

const commitMessage = getCommitMessage(ACTION_INPUT_KEY_COMMIT_MESSAGE_TEMPLATE);

modifiedFiles.forEach(async fileName => {
for (const fileName of modifiedFiles) {
await gitCommit({
filePath: fileName,
message: commitMessage.replace('%file', fileName),
});
});
}

await gitPush({ branch });

gitPush({ branch });
logBuildInfo('Build completed successfully.');
};

main().catch(setBuildFailed);
Expand Down
3 changes: 2 additions & 1 deletion test/post-samples/markdown-example-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
title: A Brief History of the World
published: false
description: The earliest stages of human history are known as prehistory, marked by the development of tools, fire, and early communication through cave art. Humans lived as hunter-gatherers, with evidence of their existence found in Africa as early as 200,000 years ago.
tags: history, civilization, prehistory, modern
tags: history, civilization, world, modern
cover_image: 'https://images.unsplash.com/photo-1521295121783-8a321d551ad2?q=80&w=2970&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D'
published_at: null
devTo: false
---

# A Brief History of the World
Expand Down
7 changes: 3 additions & 4 deletions test/post-samples/markdown-example-2.mdx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
---
title: Finding the Meaning of Life
published: false
description: >-
Discover the profound question of life's purpose with the `life-meaning-finder` Node.js library.
Explore advanced algorithms and philosophical insights to uncover a unique and personalized understanding of existence.
description: Discover the profound question of life's purpose with the `life-meaning-finder` Node.js library. Explore advanced algorithms and philosophical insights to uncover a unique and personalized understanding of existence.
tags: [philosophy, life, meaning, Node.js, library]
cover_image: 'https://unsplash.com/pt-br/fotografias/pessoa-contemplando-o-significado-da-vida'
published_at: '2022-10-01T00:00:00.000Z'
published_at: null
devTo: false
---

## **Finding the Meaning of Life with `life-meaning-finder`**
Expand Down

0 comments on commit cf56142

Please sign in to comment.