-
Notifications
You must be signed in to change notification settings - Fork 2
77 lines (67 loc) · 2.24 KB
/
Copy pathconfluence-publish.yml
File metadata and controls
77 lines (67 loc) · 2.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Publish AIDOS to Confluence
on:
workflow_call:
inputs:
manifest-path:
description: 'Path to manifest.json (leave empty to auto-discover all .aidos/manifest.json files)'
required: false
type: string
default: ''
dry-run:
description: 'Preview what would be published without calling the Confluence API'
required: false
type: boolean
default: false
secrets:
confluence_email:
required: true
confluence_token:
required: true
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout calling repo
uses: actions/checkout@v4
- name: Checkout aidos connector
uses: actions/checkout@v4
with:
repository: shobman/aidos
path: .aidos-connector
sparse-checkout: src/connectors/confluence
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: .aidos-connector/src/connectors/confluence/package-lock.json
- name: Install connector dependencies
run: npm ci
working-directory: .aidos-connector/src/connectors/confluence
- name: Publish to Confluence
env:
CONFLUENCE_EMAIL: ${{ secrets.confluence_email }}
CONFLUENCE_TOKEN: ${{ secrets.confluence_token }}
run: |
SCRIPT=".aidos-connector/src/connectors/confluence/publish.js"
INPUT_PATH="${{ inputs.manifest-path }}"
if [ -n "$INPUT_PATH" ]; then
MANIFESTS="$INPUT_PATH"
else
MANIFESTS=$(find . \
\( -path './.git' -o -path './.aidos-connector' -o -path '*/node_modules' \) -prune \
-o -type f -path '*/.aidos/manifest.json' -print | sort)
fi
if [ -z "$MANIFESTS" ]; then
echo "No manifest files found"
exit 0
fi
DRY_RUN_FLAG=""
if [ "${{ inputs.dry-run }}" = "true" ]; then
DRY_RUN_FLAG="--dry-run"
fi
for manifest in $MANIFESTS; do
echo "::group::Publishing $manifest"
node "$SCRIPT" "$manifest" $DRY_RUN_FLAG
echo "::endgroup::"
done