Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Write dev.to articles with GitHub Action.

License

NotificationsYou must be signed in to change notification settings

ful1e5/TheActionDev

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Write dev.to articles withGitHub Action.

ciReleasesCoverage

Start writingdev.to articles withTheActionDev-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 Actionhas releasedv3 which will use thejs-yaml library for parsing front-matter in articles.

I will be restricting any updates to thev1 andv2 Actions to security updates and hotfixes.

Migration fromv1 andv2 tov3

Thev3 uploader has a few breaking changes for users

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

What is TheActionDev?

TheActionDev is Github Action that allows you to write & upsert dev.toarticleswithout touching thedev.to UI. This action is initiated inActionsHackathon and usingforem API.This action is scan yourGithub Repository based ondirectoryinput and finds articles basedon theJekyll front matter inmarkdown files.

Basic Usage

  • You'll first need to create a YAML file to describe the workflow in your project(e.g. .github/workflows/TheActionDev.yml).
  • Generate dev.toapiKey by followingForem API Docs
  • Add yourapiKey toGitHub Secret by followingGitHub Docs

TheActionDev.yml

name:TheActionDev Syncon:push:branches:      -main# your default branchjobs:operations:runs-on:ubuntu-lateststeps:      -name:Checkout repouses:actions/checkout@v2      -name:Sycing Article to dev.touses:ful1e5/TheActionDev@v3with:api-key:${{ secrets.DEVTO_API_KEY }}# Store your 'api-key' in Github Secretdirectory:./articles# Your article directoryignore:Development.md, Production.md# Markdown file you wan't to ignore. Multple files separated by ,(comma)

Inputs

api-key

dev.to api key.

directory

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

ignore

The file you want to ignore by this action. Thisfeature is implemented by@actions/glob,So you also provideglob pattern with it.Following files are ignored by default :

For example, you want ignore all articles insidefoo sub-directory, Theignore input look like this:

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

Writing Article withTheActionDev

Front Matter

Original Docs atDEV 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 or date that determines whether your article is published. The next case exist:
    • Boolean istrue the article will bepublished.
    • Boolean isfalse the article will benot published.
    • Date is in thepast the article will bepublished.
    • Date is in thefuture the article will benot published.
  • description: description area in Twitter cards and open graph cards
  • tags: max of four tags, needs to beYAML Array List
  • 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.
  • organization_id: numerical identifier of the organization that this post will be publish under.

Front Matterdefault value

tagvaluerequired
titlenullyes
publishedfalseno
descriptionnullno
tags[]no
canonical_urlnullno
cover_imagenullno
seriesnullno
organization_idnullno

Article Basics

Examples

Basic Article

---title:  TheActionDevdescription: Hello Worldpublished: falsetags:  - typescript  - javascript  - githubseries: TheActionDev---First Post with **TheActionDev**{% github ful1e5/TheActionDev %}

Scheduled Article

---title:  TheActionDevdescription: Hello Worldpublished: 2023-01-01T22:00:00+02:00tags:  - typescript  - javascript  - githubseries: TheActionDev---Second Post with **TheActionDev**{% github ful1e5/TheActionDev %}

Development

Checkdocs/DEVELOPMENT.md

Branding

Inspiration

Contributing

CheckCONTRIBUTING.md, any suggestions for features and contributions to the continuing codemasterelopment can be made via the issue tracker or code contributions via aFork &Pull requests.


[8]ページ先頭

©2009-2025 Movatter.jp