docs(newsletters): Add GHA workflow to add newsletter to archive - #4030
Conversation
jgravois
left a comment
There was a problem hiding this comment.
looks pretty cool so far!
once we're done tweaking can i run the workflow manually using an old HubSpot ID just to check out the draft PR and then close it?
| - name: Set up Python | ||
| uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # 7.0.0 | ||
| with: | ||
| python-version: "3.11" |
There was a problem hiding this comment.
any reason not to use 3.12 (and pull from our .python-version file?)
There was a problem hiding this comment.
I used 3.11 because this originated in the customer-success repo, which is still using 3.11, but I'm sure it's safe to bump it up, so I'll go ahead and do that.
| - name: Add card to index | ||
| uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # 9.0.0 | ||
| with: | ||
| script: | |
There was a problem hiding this comment.
what do you think about moving this business logic into a .js file and importing it like we're doing in agency-onboarding.yml so that we can take advantage of prettier autoformatting and basic linting?
There was a problem hiding this comment.
Agreed. This is best practice.
There was a problem hiding this comment.
holler if the more modern 'import' syntax gives you any grief. things are extra convoluted in gh actions world.
|
Updates made. Tested in actions-testing repo: |
jgravois
left a comment
There was a problem hiding this comment.
looks very promising. 🎇
would be cool to run the new workflow manually for the Aug update that dropped yesterday directly from this branch, but i think we have to wait until it hits main.
| HUBSPOT_ACCESS_TOKEN: ${{ secrets.HUBSPOT_EXPORT_ACCESS_TOKEN }} | ||
| HUBSPOT_INSTANCE_ID: ${{ secrets.HUBSPOT_INSTANCE_ID }} |
There was a problem hiding this comment.
these still need to be added as new repo secrets, yes?
There was a problem hiding this comment.
if so, i could also get behind just naming the secret itself HUBSPOT_ACCESS_TOKEN.
There was a problem hiding this comment.
Yes! Thank you for the reminder. I'll do that right now.
There was a problem hiding this comment.
Ah yeah, that's sort of a weird artifact from how it was set up in the customer-success repo, but no reason not to make them consistent here. Stand by.
There was a problem hiding this comment.
Sorry for the delayed reaction and then invalidating your review. I blame GitHub not fully auto-refreshing 🤪
jgravois
left a comment
There was a problem hiding this comment.
Sorry for ... invalidating your review
all good friend. 🤝
i've seen enough flakiness in tests-ui.yml lately to know your PR isn't the cause of the errors but we can wait a beat and try rerunning prior to merge again anyway.
ac42b76 to
cf2864c
Compare
Closes #3960
This PR adds a GitHub Actions workflow to add a new newsletter to our archive in the docs.
The workflow is triggered manually, taking the HubSpot ID of a marketing email. The script fetches the web version's HTML and images, adds them to the appropriate places in the docs folder, creates the shell page, and inserts a new entry into the index page. The shell page and the index page have some TK spots for @indexing to decide how he wants to summarize the content of that particular newsletter.
It commits the work to a new branch and then opens a PR.
See it being tested at: compilerla/actions-testing#170 (Not an exact representation – some minor tweaks have been made in the code submitted here).