Skip to content

Commit 1c1991f

Browse files
authored
feat(social): add X posting for blog announcements (#51)
1 parent e36c532 commit 1c1991f

2 files changed

Lines changed: 40 additions & 4 deletions

File tree

.github/workflows/bluesky-new-post.yml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
rss_url: 'https://www.codingwithcalvin.net/rss.xml'
4343
target_date: ${{ inputs.target_date }}
4444

45-
notify:
45+
notify-bluesky:
4646
needs: detect
4747
if: needs.detect.outputs.has_posts == 'true'
4848
uses: CodingWithCalvin/.github/.github/workflows/bluesky-post.yml@main
@@ -60,9 +60,27 @@ jobs:
6060
BLUESKY_USERNAME: ${{ secrets.BLUESKY_USERNAME }}
6161
BLUESKY_APP_PASSWORD: ${{ secrets.BLUESKY_APP_PASSWORD }}
6262

63+
notify-x:
64+
needs: detect
65+
if: needs.detect.outputs.has_posts == 'true'
66+
uses: CodingWithCalvin/.github/.github/workflows/x-post.yml@main
67+
with:
68+
post_text: |
69+
New Blog Post!
70+
71+
${{ needs.detect.outputs.post_title }}
72+
73+
${{ needs.detect.outputs.post_hashtags }}
74+
embed_url: ${{ needs.detect.outputs.post_url }}
75+
secrets:
76+
X_CONSUMER_KEY: ${{ secrets.X_CONSUMER_KEY }}
77+
X_CONSUMER_KEY_SECRET: ${{ secrets.X_CONSUMER_KEY_SECRET }}
78+
X_ACCESS_TOKEN: ${{ secrets.X_ACCESS_TOKEN }}
79+
X_ACCESS_TOKEN_SECRET: ${{ secrets.X_ACCESS_TOKEN_SECRET }}
80+
6381
update-frontmatter:
64-
needs: [detect, notify]
65-
if: needs.detect.outputs.has_posts == 'true' && needs.notify.outputs.post_id != ''
82+
needs: [detect, notify-bluesky]
83+
if: needs.detect.outputs.has_posts == 'true' && needs.notify-bluesky.outputs.post_id != ''
6684
runs-on: ubuntu-latest
6785
steps:
6886
- name: Checkout blog repo
@@ -73,7 +91,7 @@ jobs:
7391
- name: Find and update blog post
7492
run: |
7593
POST_URL="${{ needs.detect.outputs.post_url }}"
76-
POST_ID="${{ needs.notify.outputs.post_id }}"
94+
POST_ID="${{ needs.notify-bluesky.outputs.post_id }}"
7795
7896
echo "Post URL: $POST_URL"
7997
echo "Post ID: $POST_ID"

.github/workflows/throwback-thursday.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,21 @@ jobs:
3434
BLUESKY_USERNAME: ${{ secrets.BLUESKY_USERNAME }}
3535
BLUESKY_APP_PASSWORD: ${{ secrets.BLUESKY_APP_PASSWORD }}
3636

37+
post-x:
38+
needs: select
39+
if: needs.select.outputs.has_post == 'true'
40+
uses: CodingWithCalvin/.github/.github/workflows/x-post.yml@main
41+
with:
42+
post_text: |
43+
Throwback! Originally posted ${{ needs.select.outputs.post_date }}
44+
45+
${{ needs.select.outputs.post_title }}
46+
47+
${{ needs.select.outputs.post_hashtags }} #ThrowbackThursday
48+
embed_url: ${{ needs.select.outputs.post_url }}
49+
secrets:
50+
X_CONSUMER_KEY: ${{ secrets.X_CONSUMER_KEY }}
51+
X_CONSUMER_KEY_SECRET: ${{ secrets.X_CONSUMER_KEY_SECRET }}
52+
X_ACCESS_TOKEN: ${{ secrets.X_ACCESS_TOKEN }}
53+
X_ACCESS_TOKEN_SECRET: ${{ secrets.X_ACCESS_TOKEN_SECRET }}
54+

0 commit comments

Comments
 (0)