-
Notifications
You must be signed in to change notification settings - Fork 1
73 lines (62 loc) · 2.48 KB
/
Copy pathsync.yml
File metadata and controls
73 lines (62 loc) · 2.48 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
name: Sync collections
on:
schedule:
- cron: '0 6 * * *'
workflow_dispatch:
inputs:
force:
description: 'Rebuild and publish every collection regardless of diff'
type: boolean
default: false
repository_dispatch:
types: [openapi-updated]
permissions:
contents: write
concurrency:
group: sync
cancel-in-progress: false
jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: oven-sh/setup-bun@v2
- run: bun install --frozen-lockfile
- name: Sync to Postman
run: bun run sync ${{ (github.event_name == 'workflow_dispatch' && inputs.force) && '--force' || '' }}
env:
POSTMAN_API_KEY: ${{ secrets.POSTMAN_API_KEY }}
- name: Commit regenerated specs, collections and UID cache
id: commit
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add specs collections collections.json
if git diff --cached --quiet; then
echo "No collection changes."
echo "changed=false" >> "$GITHUB_OUTPUT"
else
git commit -m "sync: update collections from live OpenAPI spec"
git push
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Bundle collections and environment
id: bundle
if: steps.commit.outputs.changed == 'true' || (github.event_name == 'workflow_dispatch' && inputs.force)
run: |
tag="v$(date -u +'%Y.%m.%d-%H%M')"
mkdir -p bundle
cp collections/*.json environment/roxyapi.postman_environment.json bundle/
(cd bundle && zip -q -j ../roxyapi-collections.zip ./*.json)
echo "tag=$tag" >> "$GITHUB_OUTPUT"
- name: Publish release
if: steps.bundle.outcome == 'success'
uses: softprops/action-gh-release@v3
with:
tag_name: ${{ steps.bundle.outputs.tag }}
name: Collections ${{ steps.bundle.outputs.tag }}
body: |
Postman collections for the RoxyAPI catalog, auto-generated from the live OpenAPI specs.
Import `roxyapi-collections.zip` into Postman (every domain plus a RoxyAPI environment), or fork the [public workspace](https://www.postman.com/roxylabs-7113570/roxyapi). Set the `apiKey` variable to your key and every request authenticates through `X-API-Key`.
files: roxyapi-collections.zip
make_latest: 'true'