-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (36 loc) · 1.11 KB
/
update-cross-post.yml
File metadata and controls
41 lines (36 loc) · 1.11 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
name: Update cross-posts
on:
workflow_dispatch:
inputs:
slug:
description: 'Slug to re-push (uses current source markdown)'
required: true
channels:
description: 'Comma-separated channel filter (e.g. devto). Empty = all updatable channels.'
required: false
dry_run:
description: 'Dry run (look up posts, do not update)'
type: boolean
default: true
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- name: Update cross-posts
env:
DEV_TO_API_KEY: ${{ secrets.DEV_TO_API_KEY }}
run: |
ARGS="--slug=${{ github.event.inputs.slug }}"
if [ -n "${{ github.event.inputs.channels }}" ]; then
ARGS="$ARGS --channels=${{ github.event.inputs.channels }}"
fi
if [ "${{ github.event.inputs.dry_run }}" = "true" ]; then
ARGS="$ARGS --dry-run"
fi
node scripts/update-cross-post.mjs $ARGS