-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (44 loc) · 1.24 KB
/
cross-post.yml
File metadata and controls
50 lines (44 loc) · 1.24 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
name: Cross-post blog articles
on:
push:
branches: [main]
paths:
- 'src/content/blog/**.md'
workflow_dispatch:
inputs:
slug:
description: 'Slug to cross-post (e.g. what-is-an-mcp-gateway)'
required: true
dry_run:
description: 'Dry run (print payload, do not post)'
type: boolean
default: true
jobs:
cross-post:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- name: Run unit tests
run: npm test
- name: Cross-post
env:
DEV_TO_API_KEY: ${{ secrets.DEV_TO_API_KEY }}
BSKY_HANDLE: ${{ secrets.BSKY_HANDLE }}
BSKY_APP_PASSWORD: ${{ secrets.BSKY_APP_PASSWORD }}
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
ARGS="--slug=${{ github.event.inputs.slug }}"
if [ "${{ github.event.inputs.dry_run }}" = "true" ]; then
ARGS="$ARGS --dry-run"
fi
node scripts/cross-post.mjs $ARGS
else
node scripts/cross-post.mjs
fi