Skip to content
This repository was archived by the owner on Nov 29, 2023. It is now read-only.

Commit 73f8be5

Browse files
ckoegelajrice6713
andauthored
DX-2998 Workflow for Automatic Blog Post Retrieval (#898)
* DX-2998 Workflow for Automatic Blog Post Retrieval * update jq to only return first 10 posts * Update .github/workflows/blog-posts.yml Co-authored-by: AJ Rice <[email protected]> Co-authored-by: AJ Rice <[email protected]>
1 parent a788d67 commit 73f8be5

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

.github/workflows/blog-posts.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Update Blog Posts
2+
3+
on:
4+
schedule:
5+
- cron: '0 13 * * 1'
6+
workflow_dispatch:
7+
8+
jobs:
9+
get_blog_posts:
10+
name: Get Most Recent Posts from Bandwidth Blog
11+
runs-on: ubuntu-latest
12+
# outputs:
13+
# release_needed: ${{ steps.release_needed.outputs.release_needed }}
14+
steps:
15+
- name: Get Blog Posts from Wordpress API
16+
id: get_posts
17+
run: |
18+
BLOG_POSTS=$(curl -Ls -H "Authorization: token $WORDPRESS_TOKEN" https://www.bandwidth.com/wp-json/wp/v2/posts?per_page=20 | jq '[del(.[] | select(.categories[] | contains(1680))) | .[] | {imageId: .featured_media, categories: .categories, postLink: .link, postTitle: .title.rendered}] | .[:10]')
19+
20+
echo $BLOG_POSTS
21+
env:
22+
WORDPRESS_TOKEN: ${{ secrets.WORDPRESS_TOKEN }}

0 commit comments

Comments
 (0)