Skip to content

joshghent/bookmark-action

 
 

Repository files navigation

bookmark-action

This GitHub action bookmarks websites to a JSON file. Pair it with the iOS Shortcut or click Run workflow from the Actions tab to submit details for the bookmark.

Create a workflow dispatch event with basic information about the bookmark. The action will then fetch the web page's metadata using open-graph-scraper and add it to your JSON file in your repository, always sorting by the bookmark date.

Changes from the fork

  • When you bookmark a website it goes to a

Set up the workflow

To use this action, create a new workflow in .github/workflows and modify it as needed:

name: Add bookmark

on:
  workflow_dispatch:
    inputs:
      url:
        description: The URL to bookmark.
        required: true
        type: string
      notes:
        description: Notes about the bookmark.
        type: string
      date:
        description: Date (YYYY-MM-DD). The default date is today.
        type: string

jobs:
  add_bookmark:
    runs-on: macOS-latest
    name: Add bookmark
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - name: Bookmark action
        uses: katydecorah/[email protected]
        with:
          fileName: _data/recipes.json
      - name: Download the thumbnail image
        run: curl "${{ env.BookmarkImage }}" -o "img/${{ env.BookmarkImageOutput }}"
      - name: Commit files
        run: |
          git pull
          git config --local user.email "[email protected]"
          git config --local user.name "GitHub Action"
          git add -A && git commit -m  "Bookmark ${{ env.BookmarkTitle }}"
          git push

Action options

  • fileName: The filename to save your bookmarks. Default: _data/bookmarks.json.

Trigger the action

To trigger the action, create a workflow dispatch event with the following body parameters:

{
  "ref": "main", // Required. The git reference for the workflow, a branch or tag name.
  "inputs": {
    "url": "", // Required. The URL to bookmark.
    "notes": "", // Notes about the bookmark.
    "date": "", // Date (YYYY-MM-DD). The default date is today.
  }
}

About

🔖 A GitHub action to bookmark websites to a JSON file

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 84.0%
  • JavaScript 13.9%
  • Shell 2.1%