Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
code

GitHub Action

TheActionDev

v1

TheActionDev

code

TheActionDev

Write dev.to articles with GitHub Action

Installation

Copy and paste the following snippet into your .yml file.

              

- name: TheActionDev

uses: ful1e5/TheActionDev@v1

Learn more about this action in ful1e5/TheActionDev

Choose a version

TheActionDev

dev.to articles with GitHub Action 🧑‍💻

GitHub Action Build CodeFactor TheActionDev Releases
npm type definitions License OpenSource Community Standards
Made By Kaiz


What is TheActionDev?

TheActionDev is Github Action allow you to write & Maintining dev.to articles without touching dev.to UI. This action is initiate in #ActionsHackathon and using DEV API under the hood. This action is scan your Github Repository based on directory input and find articles based on Jekyll front matter in markdown files.

Basic Usage

  • You'll first need to create a YAML file to describe the workflow in your project (e.g. .github/workflows/TheActionDev.yaml).
  • Generate dev.to apiKey by following dev.to docs
  • Add your apiKey to GitHub Secret by following Github Docs

TheActionDev.yaml

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@v1
        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)

Inputs

api-key

DEV API Key. Set inside Github Secret.

directory

Relative path to your articles files (*.md) directory

ignore

The file you want to ignore by this action. This feature is implemented by @actions/glob,So you also provide glob pattern with it.

for example, I want ignore all articles inside foo sub-directory, The action input look like this 👇.

.....

 - name: Sycing Article to dev.to
   uses: ful1e5/TheActionDev@v1
   with:
     api-key: ${{ secrets.DEVTO_API_KEY }}
     directory: ./articles
-     ignore: foo/bar.md, foo/hello.md
+     ignore: foo/**.md

.....

Listed files ignored globally by TheActionDev.

Writing Article with TheActionDev

Front Matter

Original Docs @ DEV Editor Guide 🤓

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

  • title: the title of your article
  • 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

---
title: string                     # `Required`
published: true/false             # `Required` but 'false' by default
description: string               # `Optional`
tags: string                      # `Optional` multiple tags separated by ,(comma)
series: string                    # `Optional`
cover_image: string               # `Optional` url to image
canonical_url: string             # `Optional` url
---

# The Markdown Body here

Article Body Basics

  • Use Markdown to write and format posts.
  • You can use Liquid tags to add rich content such as Tweets, YouTube videos, etc.

Example

---
title:  TheActionDev 👋
description: Hello World
published: false
tags: typescript, javascript, github
series: TheActionDev
---

First Post with **TheActionDev** 🤩

{% github ful1e5/TheActionDev %}

Development

Check docs/DEVELOPMENT.md

Branding

Inspiration

Getting Help

You can create a issue, I will help you. 🙂

Contributing

Check CONTRIBUTING.md, any suggestions for features and contributions to the continuing code masterelopment can be made via the issue tracker or code contributions via a Fork & Pull requests.

Support

Give a , So other OpenSource Ninja don't miss this.

For more support

Buy Me A Coffee

♫♪.ılılıll|̲̅̅●̲̅̅|̲̅̅=̲̅̅|̲̅̅●̲̅̅|llılılı.♫♪

Ninja is listing HardStyle