Leanpub Multi Action
A GitHub Action to interact with the Leanpub API. Preview, publish, and check job status for your Leanpub books — directly from your GitHub workflows.
Quick Start
- name: "Preview Book"
uses: "lykinsbd/leanpub-multi-action@v2"
with:
leanpub-api-key: "${{ secrets.LEANPUB_API_KEY }}"
leanpub-book-slug: "mygreatbook"
action: "preview"
Inputs
| Name | Required | Default | Description |
|---|---|---|---|
leanpub-api-key |
Yes | — | Leanpub API key (requires a Pro plan). Store as a GitHub Secret. |
leanpub-book-slug |
Yes | — | Book slug — the path component after https://leanpub.com/. |
action |
Yes | — | Action to perform: preview, publish, unpublish, check-status, book-summary, or book-exists. |
email-readers |
No | "false" |
Email readers about a new publish. Only used with publish. |
release-notes |
No | — | Release notes for the publish. Only used with publish. |
subset |
No | "false" |
Preview only the files listed in Subset.txt. Only used with preview. |
single-file |
No | — | Path to a Markdown file for single-file preview. Only used with preview. |
wait |
No | "false" |
Poll until job completes. Only used with check-status. |
poll-interval |
No | "5" |
Seconds between polls. Only used with check-status --wait. |
timeout |
No | "120" |
Max seconds to wait. Only used with check-status --wait. |
Examples
Full preview on push
---
name: "Preview on Push"
"on":
push:
branches: ["preview"]
jobs:
preview:
runs-on: "ubuntu-latest"
steps:
- name: "Preview Book"
uses: "lykinsbd/leanpub-multi-action@v2"
with:
leanpub-api-key: "${{ secrets.LEANPUB_API_KEY }}"
leanpub-book-slug: "mygreatbook"
action: "preview"
Subset preview
Preview only the files listed in your book's Subset.txt:
- name: "Subset Preview"
uses: "lykinsbd/leanpub-multi-action@v2"
with:
leanpub-api-key: "${{ secrets.LEANPUB_API_KEY }}"
leanpub-book-slug: "mygreatbook"
action: "preview"
subset: "true"
Single-file preview
Preview a single Markdown file without modifying Subset.txt.
The output PDF is saved as {slug}-single-file.pdf in your Dropbox previews folder.
- name: "Checkout"
uses: "actions/checkout@v4"
- name: "Single File Preview"
uses: "lykinsbd/leanpub-multi-action@v2"
with:
leanpub-api-key: "${{ secrets.LEANPUB_API_KEY }}"
leanpub-book-slug: "mygreatbook"
action: "preview"
single-file: "manuscript/chapter-05.md"
Publish with release notes
- name: "Publish"
uses: "lykinsbd/leanpub-multi-action@v2"
with:
leanpub-api-key: "${{ secrets.LEANPUB_API_KEY }}"
leanpub-book-slug: "mygreatbook"
action: "publish"
email-readers: "true"
release-notes: "Chapter 5 added"
Unpublish
- name: "Unpublish"
uses: "lykinsbd/leanpub-multi-action@v2"
with:
leanpub-api-key: "${{ secrets.LEANPUB_API_KEY }}"
leanpub-book-slug: "mygreatbook"
action: "unpublish"
Check job status
- name: "Check Status"
uses: "lykinsbd/leanpub-multi-action@v2"
with:
leanpub-api-key: "${{ secrets.LEANPUB_API_KEY }}"
leanpub-book-slug: "mygreatbook"
action: "check-status"
Poll until job completes
- name: "Wait for Preview"
uses: "lykinsbd/leanpub-multi-action@v2"
with:
leanpub-api-key: "${{ secrets.LEANPUB_API_KEY }}"
leanpub-book-slug: "mygreatbook"
action: "check-status"
wait: "true"
poll-interval: "10"
timeout: "300"
Get book summary
Retrieve book metadata including download URLs, word count, and sales info:
- name: "Book Summary"
uses: "lykinsbd/leanpub-multi-action@v2"
with:
leanpub-api-key: "${{ secrets.LEANPUB_API_KEY }}"
leanpub-book-slug: "mygreatbook"
action: "book-summary"
Check if book exists
- name: "Book Exists"
uses: "lykinsbd/leanpub-multi-action@v2"
with:
leanpub-api-key: "${{ secrets.LEANPUB_API_KEY }}"
leanpub-book-slug: "mygreatbook"
action: "book-exists"
CLI Usage
The action also ships as a standalone CLI tool called lma.
uv tool install leanpub-multi-action
or with pip:
pip install leanpub-multi-action
lma --leanpub-api-key YOUR_KEY --book-slug mygreatbook preview
lma --leanpub-api-key YOUR_KEY --book-slug mygreatbook preview --subset
lma --leanpub-api-key YOUR_KEY --book-slug mygreatbook preview --single-file chapter.md
lma --leanpub-api-key YOUR_KEY --book-slug mygreatbook publish --email-readers --release-notes "v2"
lma --leanpub-api-key YOUR_KEY --book-slug mygreatbook unpublish
lma --leanpub-api-key YOUR_KEY --book-slug mygreatbook check-status
lma --leanpub-api-key YOUR_KEY --book-slug mygreatbook check-status --wait --timeout 300
lma --leanpub-api-key YOUR_KEY --book-slug mygreatbook book-summary
lma --leanpub-api-key YOUR_KEY --book-slug mygreatbook book-exists
Contributing
See CONTRIBUTING.md for development setup and guidelines.
License
Metadata
Release files for leanpub-multi-action 2.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| leanpub_multi_action-2.1.0.tar.gz | 44.4 kB | Without provenance | Details for leanpub_multi_action-2.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| leanpub_multi_action-2.1.0-py3-none-any.whl | Python 3 | none | any | Details for leanpub_multi_action-2.1.0-py3-none-any.whl |
Total release size: 55.2 kB
Release files / leanpub_multi_action-2.1.0.tar.gz
| Download URL | leanpub_multi_action-2.1.0.tar.gz |
|---|---|
| Size | 44.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0cf056dff314f973c00a30b22b249234b77864bd394a7d8f0aa950f1c07cbd81
|
|
BLAKE2b-256 checksum How to use checksums |
6ad8ff34a8464bfa6d17ae1dc67141f6778de9bb91e87eae5b8e16bc1c7ae5e3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / leanpub_multi_action-2.1.0-py3-none-any.whl
| Download URL | leanpub_multi_action-2.1.0-py3-none-any.whl |
|---|---|
| Size | 10.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
72c04d16fcb2f9999d291db1bf320da8ee61199b15cf0de33c819b67e6506674
|
|
BLAKE2b-256 checksum How to use checksums |
6e32eea667762813ba4c339c3a84364cadccd1fd437f50e0e00a119dd4c437fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for leanpub-multi-action 2.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.