This GitHub Action generates daily or weekly digests for a Ghost blog. It fetches posts from the Ghost Admin API, filters them based on the specified period, and creates a new digest post with customizable tags and title. The action also supports debug logging and allows for timezone customization.
url
: (Required) URL of the Ghost blog.period
: (Required) Digest period. Choose betweendaily
orweekly
. Defaults todaily
.debug
: (Optional) Enable debug logging. Defaults tofalse
.tags
: (Optional) Comma-separated list of tags for the digest post. Defaults toDigest
.title
: (Optional) Title of the digest post. Defaults to{{period}} Digest
.timezone
: (Optional) Timezone to use for date calculations. Defaults toAmerica/Chicago
.
GHOST_API_KEY
: (Required) Admin API key from your Ghost Admin integrations section
result
: The result of the digest generation, including the slug of the created post.
name: Daily Digest
on:
schedule:
- cron: '0 4 * * *' # Runs at 4 AM UTC, which is 11 PM CDT
workflow_dispatch: # Allows manual triggering of the workflow
jobs:
generate-digest:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Generate Digest
uses: robdel12/[email protected]
with:
url: 'https://example-url.com'
period: daily
debug: true
tags: Digest,Daily
title: 'Daily Digest'
timezone: America/New_York
env:
GHOST_API_KEY: ${{ secrets.GHOST_API_KEY }}
To test and develop this action locally, you can run it with Node.js. Make sure you have all dependencies installed:
npm install
node index.js
Make sure to set the necessary environment variables for local testing, such as GHOST_API_KEY
.
This action is licensed under the MIT License. See the LICENSE file for more information.