DEV Community

Cover image for TheActionDev - v3
Kaiz Khatri
Kaiz Khatri

Posted on • Updated on • Originally published at github.com

TheActionDev - v3

What's TheActionDev?

TheActionDev is Github Action that allows you to write & upsert dev.to articles without touching the dev.to UI. This action is initiated in ActionsHackathon and using forem API.

The main goal of TheActionDev is that we can write articles in favorite text editor, make articles collaborative like open source software and, to have version control system for article as software .

Check On GitHub Marketplace

https://github.com/marketplace/actions/theactiondev

Migrating to v3

There is nothing new in v3 but minor changes have been made to the development workflow, Mainly releases tags and branches. Now release tags follow semantic versions with the v prefix. This release pattern allows us to point to a specific version tag and also helps us to merge commits into release branches from main without re-creating the already released version. You can view all changes of v3 in the project's git history.

The main reason behind this release is native YAML support in front-matter thanks to js-yaml library. This means you have to assign the tags key as yaml arrays otherwise, Action will throw an error or ignore the assigned tags.

---
...
- tags: typescript, javascript, github
+ tags:
+   - typescript
+   - javascript
+   - github
...
---

...
Enter fullscreen mode Exit fullscreen mode

Other than that, You will find the updated notice in the README#Notice section as we'll introduce any kind of breaking changes or deprecations.

Getting Started

Setup

  1. You'll first need to create a YAML file to describe the workflow in your project (e.g. .github/workflows/TheActionDev.yml).
  2. Generate dev.to apiKey by following Forem API Docs
  3. Add your apiKey to GitHub Secret DEVTO_API_KEY by following GitHub Docs

TheActionDev.yml

name: TheActionDev Sync
on:
  push:
    branches:
      - main # your default branch

jobs:
  operations:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repo
        uses: actions/checkout@v2

      - name: Sycing Article to dev.to
        uses: ful1e5/TheActionDev@v3
        with:
          api-key: ${{ secrets.DEVTO_API_KEY }} # Store your 'api-key' in Github Secret
          directory: ./articles # Your article directory
          ignore: Development.md, Production.md # Markdown file you wan't to ignore. Multple files separated by ,(comma)
Enter fullscreen mode Exit fullscreen mode

Front-Matter

Custom variables set for each post, located between the triple-dashed lines in your editor Here is a list of possibilities:

  • published: boolean that determines whether or not your article is published
  • description: description area in Twitter cards and open graph cards
  • tags: max of four tags, needs to be comma-separated
  • canonical_url: link for the canonical version of the content
  • cover_image: cover image for post, accepts a URL. The best size is 1000 x 420.
  • series: post series name.

Front Matter default value

tag value required
title null yes
published false no
description null no
tags [] no
canonical_url null no
cover_image null no
series null no

Article Example

---
title: Hello from TheActionDev
description: Hello World
published: false
tags:
  - showdev
  - github
series: foo
---

Just Setup **TheActionDev** for writing dev.to artcles.

{% github ful1e5/TheActionDev %}
Enter fullscreen mode Exit fullscreen mode

Track Sync

You're able track your article status in Actions tab.

Action Tab

Something Missing?

If something is missing in the documentation or if you found some part confusing, please file an issue on the repository with your suggestions for improvement, or tweet at the @ful1e5 account. I love hearing from you!

Support my work with $1 or more on GitHub Sponsors.

GitHub logo ful1e5 / TheActionDev

Write dev.to articles with GitHub Action.

TheActionDev

Write dev.to articles with GitHub Action.

ci Releases Coverage

Start writing dev.to articles with TheActionDev-template

Notice

⚠️ Deprecation of v1 and v2

As of May 28, 2022, v1 and v2 has been fully sunset and no longer functions

Due to the deprecation of the underlying utility functions, the TheActionDev GitHub Action has released v3 which will use the js-yaml library for parsing front-matter in articles.

I will be restricting any updates to the v1 and v2 Actions to security updates and hotfixes.

Migration from v1 and v2 to v3

The v3 uploader has a few breaking changes for users

  • Multiple tags have not been assigned as string with colon(,) or have been deprecated. Instead of use YAML Array List to assign it.

What is TheActionDev?

TheActionDev is Github Action that allows you to write & upsert dev.to articles without touching the dev.to UI. This action is initiated in ActionsHackathon and using…

Top comments (0)