You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tools/blog_automation/README.md
+44-9Lines changed: 44 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,10 +17,10 @@ To allow our scripts to access Google Drive and export documents, you need to cr
17
17
👉 **Note:** You need the **Project Editor** or **Owner** role on this project to create service accounts and keys.
18
18
If you’re the one who created the project, you already have these permissions.
19
19
20
-
### 1. Enable the Drive API
20
+
### 1. Enable the Drive and Sheets APIs
21
21
1. In the left menu, go to **APIs & Services → Library**.
22
-
2. Search for **Google Drive API**.
23
-
3.Click **Enable**.
22
+
2. Search for **Google Drive API** and click **Enable**.
23
+
3.Search for **Google Sheets API** and click **Enable** (needed to read the submissions spreadsheet).
24
24
25
25
### 2. Create a Service Account
26
26
1. In the left menu, go to **IAM & Admin → Service Accounts**.
@@ -47,6 +47,7 @@ If you’re the one who created the project, you already have these permissions.
47
47
4. Give it at least **Viewer** access.
48
48
5. Save changes.
49
49
- Now the service account can read/export files in that folder or doc.
50
+
6. Repeat the **Share** step for the **blog submissions spreadsheet** (the Google Form responses sheet), giving the service account **Editor** access. Editor (not just Viewer) is required because the pipeline writes `isPublished = TRUE` back to a row after exporting it.
50
51
51
52
---
52
53
@@ -75,19 +76,53 @@ Then the **Document ID** is:
75
76
76
77
Use this ID in your scripts when exporting the document.
2. Run the script: `python blog_exporter [--row_index <ROW_INDEX>]`, where the row_index refers to the row of the CSV. This defaults to -1, or the last row in the CSV.
This is handy to check a Doc renders correctly. The full pipeline below reads all
85
+
of this metadata from the spreadsheet automatically.
84
86
85
87
## Tests
86
88
87
89
Run `pytest test_blog_exporter.py`
88
90
89
-
## GitHub Actions automation
90
-
There is a GitHub Action .github/workflows/run_blog_exporter.yml which checks for any new rows in the blog_info_snapshot.csv, and runs the blog_exporter.py script for each new row.
91
+
## CI/CD pipeline: publish a blog when you mark it reviewed
92
+
93
+
The Google Sheet is the **single source of truth** — there is no local CSV. The
0 commit comments