Repository navigation
Expand file tree
/
Copy pathaction.yml
More file actions
68 lines (63 loc) · 2.55 KB
/
Copy pathaction.yml
File metadata and controls
68 lines (63 loc) · 2.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Sync Markdown to NotebookLM
description: Bundle your repo's Markdown per top-level folder and keep it in sync as NotebookLM sources on every push.
author: patrick-creates
inputs:
notebook-id:
description: 'NotebookLM notebook ID (the part after /notebook/ in the URL)'
required: true
cookies:
description: 'Contents of cookies.json from notebooklm-mcp-cli (store as a secret)'
required: true
metadata:
description: 'Contents of metadata.json from notebooklm-mcp-cli (store as a secret)'
required: false
default: '{}'
force-sync:
description: 'Re-upload every folder bundle, not only changed ones'
required: false
default: 'false'
runs:
using: composite
steps:
- name: Install NotebookLM CLI
shell: bash
# Pinned: 0.5.x stored "<file>.md" as title, newer versions store the bare title.
# Dedup matches both, but the pin keeps a silent upgrade from changing the schema again.
# Must match CLI_VERSION in nlm_auth.py, or the saved login may not load here.
run: pip install notebooklm-mcp-cli==0.15.5
- name: Setup Authentication Profile
shell: bash
env:
NLM_COOKIES: ${{ inputs.cookies }}
NLM_METADATA: ${{ inputs.metadata }}
run: |
set -euo pipefail
CONFIG_DIR="$HOME/.notebooklm-mcp-cli/profiles/default"
mkdir -p "$CONFIG_DIR"
printf '%s' "$NLM_COOKIES" > "$CONFIG_DIR/cookies.json"
printf '%s' "$NLM_METADATA" > "$CONFIG_DIR/metadata.json"
- name: Verify Authentication
shell: bash
env:
NB_ID: ${{ inputs.notebook-id }}
run: |
set -euo pipefail
if ! nlm login --check 2>&1; then
echo "::error::NotebookLM auth expired (session ping failed). Re-run nlm_auth.py locally and update GitHub secrets."
exit 1
fi
# Write-scope probe: the session ping can pass while write cookies are expired.
if ! nlm source list "$NB_ID" --json > "$RUNNER_TEMP/nlm-probe.log" 2>&1; then
echo "::error::NotebookLM write-scope auth invalid or notebook not found (source list failed). Check NOTEBOOK_ID, then re-run nlm_auth.py and update GitHub secrets."
echo "::group::nlm source list output"
tail -30 "$RUNNER_TEMP/nlm-probe.log"
echo "::endgroup::"
exit 1
fi
- name: Smart Sync Bundles
shell: bash
env:
NB_ID: ${{ inputs.notebook-id }}
FORCE_SYNC: ${{ inputs.force-sync }}
BEFORE_SHA: ${{ github.event.before }}
run: bash "$GITHUB_ACTION_PATH/scripts/sync.sh"