Skip to content

How to use Github Action as your free & no code Medium Posts backup service

ZhgChgLi edited this page Nov 24, 2023 · 4 revisions

How to use Github Action as your free & no-code Medium Posts backup service

  • Free: About billing for GitHub Actions
  • Unlimited storage
  • Version control of backup posts
  • No Code, no need to know how to coding
  • No Local Environment Requirement, no matter what is your computer environment, you can also use this on your smartphone :)

image

  • Repository name: Enter the name which you want
  • Public or Private: everyone can see your repo if you set it to public

Step 2. Creating an Action

image

  • Click Actions on top menu

image

  • Click set up a workflow yourself

image

  • (optional) Replace file name to ZMediumToMarkdown.yml
  • Replace the entire content to:
name: ZMediumToMarkdown
on:
  workflow_dispatch:
  schedule:
    - cron: "10 1 15 * *" # At 01:10 on day-of-month 15. (once a month)

jobs:
  ZMediumToMarkdown:
    runs-on: ubuntu-latest
    steps:
    - name: ZMediumToMarkdown Automatic Bot
      uses: ZhgChgLi/ZMediumToMarkdown@main
      with:
        command: '-u YourMediumUserName'

image

  • Click Start Commit button on the right-top and Click Commit New File

image

  • File Commit (Saved) Success!

[2023/11 Update] Step 2-1. Change Workflow Permissions

Settings -> Actions -> General -> Workflow Permissions -> Read and write permissions -> ✅

1_1ZHF9CIOMV8S12Xw2P4B8g

Step 3. Running backup for the first time manually

image

  • Click Actions on top menu
  • Click the Action which you just created: ZMediumToMarkdown
  • Click Run workflow button on the top-right
  • Click Run workflow button

image

  • Refresh Page until the job is showing

image image

  • Click into ZMediumToMarkdown job to know current backup process
  • Waiting download process (I have 65 posts and take about 10 minutes to download)

image

  • You'll see Succes Status if finished downloading

Check backup posts

image

  • Click Code on top menu
  • Click Output Folder

Make Sure the backup job in action is finished & successful, or you won't see any output result.

image

  • All set!

Suspend auto-backup job

image

  • Click Actions on top menu
  • Click the Action which you just created: ZMediumToMarkdown
  • Click ... button on top-right
  • Click Disable workflow
  • auto-backup job will be suspended

Edit Medium's user or backup schedule

image

  • Click Actions on top menu
  • Click the Action which you just created: ZMediumToMarkdown
  • Click action file ZMediumToMarkdown.yml on top-left

image

  • Click Pen Icon button on top-right
  • ref Creating an Action up above

Example Repo

https://github.com/ZhgChgLi/ZMediumToMarkdown-github-action

If you are facing Run ZMediumToMarkdown Automatic Bot Failed ❌

remote: Write access to repository not granted.
fatal: unable to access 'https://github.com/zhgtest/test-init/': The requested URL returned error: 403
Error: Invalid status code: 128
    at ChildProcess.<anonymous> (/home/runner/work/_actions/stefanzweifel/git-auto-commit-action/v4/index.js:17:19)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1100:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5) {
  code: 128
}

Error: Invalid status code: 128
    at ChildProcess.<anonymous> (/home/runner/work/_actions/stefanzweifel/git-auto-commit-action/v4/index.js:17:19)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1100:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)

Please follow step 2-1 and retry running github action.