You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
GitHub Action
Post to Medium Action
v0.3
GitHub Action that allows you to automatically create a new Medium post with Markdown or HTML.
Report Bug
·
Request Feature
Functional
The easiest way to use this action is to add the following into your workflow file. Additional configuration might be necessary to fit your usecase.
-
Add the following part in your workflow file:
jobs: post-to-medium: name: Post to Medium runs-on: ubuntu-latest steps: - name: Create Medium Post uses: philips-software/[email protected] with: integration_token: "${{ secrets.INTEGRATION_TOKEN }}" content: "content here" content_format: "markdown" notify_followers: "false" publication_name: "publication" tags: "test,tag" title: "title" license: "all-rights-reserved" publish_status: "draft"
parameter | description | required | default |
---|---|---|---|
integration_token | Medium's Integration Token. Token can be retrieved at medium.com, settings section, under 'Integration Token.' | true |
|
content | Content to add in the post, can be either HTML or Markdown. Use either this parameter, or the file parameter. | false |
|
content_format | The format of the content field. There are two valid values, html, and markdown. | true |
|
file | Absolute path to the file to use as content, can be either HTML or Markdown. Use either this parameter, or the content parameter. | false |
|
publish_status | Post's status. Valid values are 'draft', 'public', or 'unlisted'. | false |
draft |
notify_followers | Whether to notify followers that the user has published. | false |
false |
license | Post's license. Valid values are 'all-rights-reserved', 'cc-40-by', 'cc-40-by-sa', 'cc-40-by-nd', 'cc-40-by-nc', 'cc-40-by-nc-nd', 'cc-40-by-nc-sa', 'cc-40-zero', 'public-domain'. | false |
all-rights-reserved |
publication_name | The name of the publication the post is being created under. Either PublicationName of PublicationId should be set. | false |
|
publication_id | The id of the publication the post is being created under. If you do not know the Id, use PublicationName. | false |
|
canonical_url | The canonical URL of the post. If canonicalUrl was not specified in the creation of the post, this field will not be present. | false |
|
tags | The post’s tags. Provide a comma separated string without spaces. | true |
|
title | The post's title. | true |
|
parse_frontmatter | Should the action read and delete frontmatter in a markdown file. Frontmatter should start with --- and end with ---. Should be on the top of the page. When parsing frontmatter, only markdown is supported and settings will be overwritten if specified in the frontmatter. | true |
false |
parameter | description |
---|---|
id | ID of the Medium post. |
author_id | Author ID of the post creator. |
canonical_url | Canonical URL of the post. |
license | License of the post, can be empty at times. |
license_url | License url of the post, Medium uses this under the hood. |
publication_id | Id of the publication which the post is created under. |
publication_status | Publication status of the post. |
title | Title of the post. |
tags | Tags of the post, comma separated. |
url | URL to the Medium post. |
If you have a suggestion that would make this project better, please fork the repository and create a pull request. You can also simply open an issue with the tag "enhancement".
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.