{"id":17788066,"url":"https://github.com/trystan2k/publish-blog-post","last_synced_at":"2026-02-01T19:14:15.163Z","repository":{"id":259339938,"uuid":"868172485","full_name":"trystan2k/publish-blog-post","owner":"trystan2k","description":"A GitHub Action that publish markdown files as post to Dev.to and Medium","archived":false,"fork":false,"pushed_at":"2026-01-27T10:24:06.000Z","size":1726,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-27T22:41:07.395Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trystan2k.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-10-05T16:58:55.000Z","updated_at":"2026-01-27T10:22:53.000Z","dependencies_parsed_at":"2024-10-24T15:46:40.369Z","dependency_job_id":"5b2ad81c-f09f-4609-8d3b-911917283a11","html_url":"https://github.com/trystan2k/publish-blog-post","commit_stats":null,"previous_names":["trystan2k/publish-blog-post"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/trystan2k/publish-blog-post","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trystan2k%2Fpublish-blog-post","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trystan2k%2Fpublish-blog-post/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trystan2k%2Fpublish-blog-post/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trystan2k%2Fpublish-blog-post/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trystan2k","download_url":"https://codeload.github.com/trystan2k/publish-blog-post/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trystan2k%2Fpublish-blog-post/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28987086,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T18:17:03.387Z","status":"ssl_error","status_checked_at":"2026-02-01T18:16:57.287Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-27T10:16:21.524Z","updated_at":"2026-02-01T19:14:15.148Z","avatar_url":"https://github.com/trystan2k.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Publish Blog Post\n\n[![CI](https://github.com/trystan2k/publish-blog-post/actions/workflows/ci.yml/badge.svg)](https://github.com/trystan2k/publish-blog-post/actions/workflows/ci.yml)\n\n- [📍 Overview](#-overview)\n- [👾 Features](#-features)\n  - [Functionality](#functionality)\n  - [Code Quality](#code-quality)\n  - [Testing](#testing)\n  - [Dependencies](#dependencies)\n- [🚀 Getting Started](#-getting-started)\n  - [Permissions](#permissions)\n  - [API Key](#api-key)\n  - [Workflow File](#workflow-file)\n  - [Usage](#usage)\n- [🏗️ Building the Project](#️-building-the-project)\n  - [Installation](#installation)\n  - [Build](#build)\n  - [Tests](#tests)\n- [🤝 Contributing](#-contributing)\n- [👥 Contributor Graph](#contributor-graph)\n- [🎗 License](#-license)\n- [🔖 References](#-references)\n\n---\n\n## 📍 Overview\n\nThe Publish Blog Post action is a GitHub Action that automates the process of publishing blog posts to various platforms, such as Dev.to and Medium. The action reads the markdown content from a specified file and based on its front matter data publishes or updates the post to the selected platform using the respective API.\n\nThe action get the list of files to process (new or updated) by comparing the current commit with the previous commit. It then reads the front matter of the markdown file to extract metadata such as title, description, tags, etc. The action then publishes or updates the post to the selected platform using the respective API.\n\n---\n\n## 👾 Features\n\n### Functionality\n\nThe action provides the following features:\n\n- **Publish new posts**: Publishes blog posts to supported/configured hosting (currently only Dev.to).\n- **Update Existing Posts**: Updates existing posts on supported/configured hosting (currently only Dev.to).\n\n### Code Quality\n\n- **TypeScript**: The action is developed using TypeScript, ensuring type safety and code consistency.\n- **ESLint and Prettier**: The codebase adheres to best practices using ESLint and Prettier for consistent code formatting.\n- **Unit Tests**: The action includes unit tests to validate the correctness of individual functions and modules.\n\n### Testing\n\n- **Vitest**: The action utilizes Vitest for testing, ensuring the reliability and accuracy of the codebase.\n- **Code Coverage**: The action maintains a high code coverage percentage, guaranteeing comprehensive testing.\n\n### Dependencies\n\n**KY**: Tiny \u0026 elegant JavaScript HTTP client based on the Fetch API ussed to make HTTP requests to the Dev.to API.\n**gray-matter**: Used to parse the front matter of the markdown file to extract metadata such as title, description, tags, etc.\n\n---\n\n## 🚀 Getting Started\n\nTo use the Publish Blog Post action, it is necessary to configure the required permissions and API keys. Later you need to create a workflow file in your repository to trigger the action.\n\n### Permissions\n\nIt is necessary to enable `Read and write permissions` for the GitHub Token in the repository settings. This permission is required to access and modify markdown files within the repository.\n\n1. Navigate to the repository `Settings`.\n2. Expand the `Actions` section and click on `General`\n3. Scroll down to the `Permissions` section and ensure that the `Read and write permissions` are enabled for the GitHub Token.\n\n### API Key\n\nTo use the action, you need to obtain an API key for the choosen Blog Post Hosting. Follow these steps to create an API key:\n\n#### Dev.to API\n\nTo use the Dev.to API, you need to create an API key. Follow these steps to create an API key:\n\n1. Go to [Dev.to](https://dev.to/) and sign in to your account.\n2. Navigate to the [Settings -\u003e Exetensions](https://dev.to/settings/extensions) page.\n3. Scroll down and click on the `Generate API Key` button after defining the description.\n4. Copy the generated API key.\n\nOnce you have obtained the API key, add it to the repository secrets as `DEV_TO_API_KEY`.\n\n1. Navigate to the repository `Settings`.\n2. Expand the `Secrets and variables` section and click on `Actions`.\n3. Click on `New repository secret`.\n4. Add the\n   - `Name`: `DEV_TO_API_KEY`\n   - `Value`: `\u003cYour Dev.to API Key\u003e`\n\n### Workflow File\n\nCreate a new workflow file in your repository to trigger the Publish Blog Post action. The workflow file should be placed in the `.github/workflows` directory.\n\n#### Inputs\n\nThe action requires the following inputs:\n\n| Name            | Required                             | Default Value                            | Description                                                                                       |\n|-----------------|--------------------------------------|------------------------------------------|---------------------------------------------------------------------------------------------------|\n| token           | true                                 | `${{ github.token }}`                    | The GitHub token to access the repository.                                                        |\n| publishTo       | true                                 | `devTo`                                  | The hostings to publish/update the post. Comma separated values. Supported values: 'devTo'        |\n| devToApiKey     | true (if publishTo contains 'devTo') |                                          | The API key for the devTo Blog Post Hosting.                                                      |\n| includeFolders  | false                                |                                          | Folders to look for post files to publish/update. Multiple folders can be specified, one per line. If not defined, all folders will be checked |\n| commitMessage   | false                                | `publish/update %file with updated data` | The commit message template for review suggestions. %file is replaced by file path                |\n\nExample of a workflow file:\n\n```yaml\nname: Test Publish Blog Post Action\n\non:\n  push:\n    branches:\n      - main\n\njobs:\n  publish-blog-post::\n    runs-on: ubuntu-latest\n    name: A test job to run the Publish Blog Post action\n    steps:\n      # To use this repository's private action,\n      # you must check out the repository\n      - name: Checkout\n        uses: actions/checkout@v4\n        # IMPORTANT: Fetch all history for all tags and branches so it can compare commits and get files changed\n        with:\n          fetch-depth: 0\n      - name: Test the publish-blog-post action\n        uses: trystan2k/publish-blog-post@v1\n        id: publish-blog-post\n        with:\n          devToApiKey: ${{ secrets.DEV_TO_API_KEY }}\n          includeFolders: |-\n            post-samples\n\n```\n\n### Usage\n\n## 🏗️ Building the Project\n\nEnsure you have Node.js and PNPM installed on your machine before proceeding with the installation.\n\n```sh\n❯ node -v\n\u003e= 20.0.0\n\n❯ pnpm -v\n\u003e= 9.9.0\n```\n\n### Installation\n\nBuild the project from source:\n\n1. Clone the repository:\n\n```sh\n❯ git clone git@github.com:trystan2k/publish-blog-post.git\n```\n\n2. Navigate to the project directory:\n\n```sh\n❯ cd publish-blog-post\n```\n\n3. Install the required dependencies:\n\n```sh\n❯ pnpm install\n```\n\n### Build\n\nTo build the project for distribution, run the following command:\n\n```sh\n❯ pnpm build\n```\n\n### Tests\n\nExecute the test suite using the following command:\n\n```sh\n❯ pnpm test\n```\n\n---\n\n## 🤝 Contributing\n\nContributions are welcome! Here are several ways you can contribute:\n\n- **[Report Issues](https://github.com/trystan2k/publish-blog-post/issues)**: Submit bugs found or log feature requests for the `app` project.\n- **[Submit Pull Requests](/CONTRIBUTING.md)**: Review open PRs, and submit your own PRs.\n\n---\n\n## Contributor Graph\n\n\u003cp align=\"left\"\u003e\n   \u003ca href=\"https://github.com/trystan2k/publish-blog-post/graphs/contributors\"\u003e\n      \u003cimg src=\"https://contrib.rocks/image?repo=trystan2k/publish-blog-post\" /\u003e\n   \u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n## 🎗 License\n\nThis project is protected under the [MIT](https://choosealicense.com/licenses/mit/) License. For more details, refer to the [LICENSE](/LICENSE) file.\n\n---\n\n## 🔖 References\n\n### GitHub Actions\n\n- [GitHub Actions](https://docs.github.com/en/actions)\n\n### Dev.to API\n\n- [Dev.to API](https://docs.dev.to/api/)\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrystan2k%2Fpublish-blog-post","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrystan2k%2Fpublish-blog-post","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrystan2k%2Fpublish-blog-post/lists"}