Skip to content

Commit 0a804ea

Browse files
committed
feat: created collection from code
1 parent c85b805 commit 0a804ea

82 files changed

Lines changed: 5030 additions & 364 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/postman.yaml

Lines changed: 14 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -2,95 +2,31 @@ name: Publish to Postman Workspace
22

33
on:
44
push:
5-
branches:
6-
- main
5+
branches: [main]
76
pull_request:
8-
branches:
9-
- main
7+
branches: [main]
108
workflow_dispatch:
119

1210
jobs:
13-
quality-checks:
14-
name: Validate API and Collections
11+
postman:
1512
runs-on: ubuntu-latest
16-
1713
steps:
18-
- name: Checkout repository
19-
uses: actions/checkout@v4
14+
- uses: actions/checkout@v4
2015

21-
- name: Set up Node.js
22-
uses: actions/setup-node@v4
16+
- uses: actions/setup-node@v4
2317
with:
24-
node-version: '>= 20.19.0'
25-
cache: 'yarn'
26-
27-
- name: Install dependencies
28-
run: yarn install
18+
node-version: "20"
19+
cache: "yarn"
2920

30-
- name: Install Postman CLI
31-
run: curl -o- "https://dl-cli.pstmn.io/install/unix.sh" | sh
21+
- run: curl -o- "https://dl-cli.pstmn.io/install/unix.sh" | sh
3222

33-
- name: Verify Postman CLI version
34-
run: postman --version
35-
36-
- name: Login to Postman
23+
- name: Validate and sync
3724
env:
3825
POSTMAN_API_KEY: ${{ secrets.POSTMAN_API_KEY }}
39-
run: postman login --with-api-key "$POSTMAN_API_KEY"
40-
41-
- name: Run unit and integration tests
42-
run: yarn test
43-
44-
- name: Run Spectral linting on collections
45-
run: yarn lint:collections
46-
47-
- name: Start API server
4826
run: |
27+
postman login --with-api-key "$POSTMAN_API_KEY"
28+
yarn install --frozen-lockfile
4929
yarn start &
50-
echo $! > server.pid
51-
52-
- name: Wait for API readiness
53-
run: |
54-
for attempt in {1..30}; do
55-
if curl -sSf http://localhost:3000/health >/dev/null; then
56-
exit 0
57-
fi
58-
if curl -sSf http://localhost:3000 >/dev/null; then
59-
exit 0
60-
fi
61-
sleep 1
62-
done
63-
echo "API did not become ready in time." >&2
64-
exit 1
65-
66-
- name: Run Postman collection tests
67-
run: yarn test:api
68-
69-
- name: Stop API server
70-
if: always()
71-
run: |
72-
if [ -f server.pid ]; then
73-
kill $(cat server.pid) || true
74-
rm server.pid
75-
fi
76-
77-
- name: Show workspace configuration
78-
if: github.event_name != 'pull_request'
79-
run: |
80-
echo "🧩 Workspace Configuration:"
81-
cat .postman/config.json
82-
echo ""
83-
echo "📁 Collections to sync:"
84-
ls -la postman/collections/
85-
echo ""
86-
echo "🌍 Environments to sync:"
87-
ls -la postman/environments/
88-
89-
- name: Push workspace to Postman
90-
run: postman workspace push -y
91-
92-
- name: Confirm sync success
93-
if: github.event_name != 'pull_request'
94-
run: |
95-
echo "✅ Workspace successfully synced!"
96-
echo "🌐 View your workspace at: https://web.postman.co/workspace/a6c44822-f001-4728-b0d4-5a1917289054"
30+
sleep 3
31+
yarn test:api
32+
postman workspace push -y

.postman/config.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"workspace": {
3+
"id": "d1e588f0-0683-446f-8304-0ceb03a8746b"
4+
},
5+
"entities": {
6+
"environments": [],
7+
"flows": [],
8+
"globals": [],
9+
"mocks": [],
10+
"specs": [
11+
"../openapi/openapi.yaml"
12+
],
13+
"collections": []
14+
}
15+
}

.postman/sync.lock.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
07abec89-2a86-43d1-a72b-66378bc287c9:
2+
path: postman/collections/Intergalactic Bank API
3+
lastPulledAt: '2026-02-19T12:10:40.312Z'
4+
lastPushedAt: ''

0 commit comments

Comments
 (0)