-
Notifications
You must be signed in to change notification settings - Fork 0
172 lines (146 loc) · 6.75 KB
/
Copy pathupdate-idp-openapi-spec.yml
File metadata and controls
172 lines (146 loc) · 6.75 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
name: Update Authlete IdP OpenAPI Specification
on:
schedule:
# Run daily at 2:30 AM UTC to check for updates
- cron: "30 2 * * *"
workflow_dispatch:
# Allow manual trigger
permissions:
contents: write
pull-requests: write
jobs:
update-idp-openapi-spec:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install dependencies
run: uv sync
- name: Update IdP OpenAPI specification
id: update-spec
run: |
echo "Updating IdP OpenAPI specification..."
uv run python scripts/update_idp_openapi_spec.py
- name: Determine IdP spec branch name
id: branch-info
run: |
SPEC_HASH="${{ steps.update-spec.outputs.spec-sha256 }}"
if [ -z "$SPEC_HASH" ] || [ "$SPEC_HASH" = "unknown" ]; then
if [ -f "resources/idp-openapi-spec.json" ]; then
SPEC_HASH=$(sha256sum resources/idp-openapi-spec.json | cut -d' ' -f1)
else
SPEC_HASH="${{ github.run_id }}"
fi
fi
BRANCH="update-idp-openapi-spec-${SPEC_HASH:0:12}"
echo "branch=$BRANCH" >> $GITHUB_OUTPUT
echo "TARGET_BRANCH=$BRANCH" >> $GITHUB_ENV
echo "Using branch $BRANCH for this update"
- name: Check for existing IdP spec PR
id: existing-pr
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [ "${{ steps.update-spec.outputs.has-changes }}" != "true" ]; then
echo "exists=false" >> $GITHUB_OUTPUT
exit 0
fi
BRANCH="${{ steps.branch-info.outputs.branch }}"
if [ -z "$BRANCH" ]; then
echo "exists=false" >> $GITHUB_OUTPUT
exit 0
fi
if ! command -v gh >/dev/null 2>&1; then
echo "GitHub CLI not available - assuming no existing PR"
echo "exists=false" >> $GITHUB_OUTPUT
exit 0
fi
PR_COUNT=$(gh pr list --state open --head "$BRANCH" --repo "$GITHUB_REPOSITORY" --json number --jq 'length')
if [ "$PR_COUNT" -gt 0 ]; then
echo "An open PR already exists for $BRANCH (count: $PR_COUNT)"
echo "exists=true" >> $GITHUB_OUTPUT
else
echo "exists=false" >> $GITHUB_OUTPUT
fi
- name: Create Pull Request
if: steps.update-spec.outputs.has-changes == 'true' && steps.existing-pr.outputs.exists != 'true'
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: |
chore: update Authlete IdP OpenAPI specification
- Updated from Authlete IdP API (https://login.authlete.com/v3/api-docs)
- Version: ${{ steps.update-spec.outputs.current-version }} → ${{ steps.update-spec.outputs.new-version }}
- Paths: ${{ steps.update-spec.outputs.current-paths }} → ${{ steps.update-spec.outputs.new-paths }}
- Generated YAML and JSON specifications for reference
- Content hash: ${{ steps.update-spec.outputs.spec-sha256 }}
Auto-generated by update-idp-openapi-spec workflow
branch: ${{ steps.branch-info.outputs.branch }}
delete-branch: true
title: "chore: update Authlete IdP OpenAPI specification to v${{ steps.update-spec.outputs.new-version }}"
body: |
## Authlete IdP OpenAPI Specification Update
This PR updates the Authlete IdP OpenAPI specification from the latest IdP API documentation.
**Changes:**
- **Version:** `${{ steps.update-spec.outputs.current-version }}` → \
`${{ steps.update-spec.outputs.new-version }}`
- **API Endpoints:** `${{ steps.update-spec.outputs.current-paths }}` → \
`${{ steps.update-spec.outputs.new-paths }}`
- **Content Hash:** `${{ steps.update-spec.outputs.spec-sha256 }}`
- **Source:** https://login.authlete.com/v3/api-docs
**Files Updated:**
- `resources/idp-openapi-spec.yaml` - IdP OpenAPI specification (YAML format)
- `resources/idp-openapi-spec.json` - IdP OpenAPI specification (JSON format)
**Context:**
The Authlete IdP API currently supports limited operations with `ORGANIZATION_ACCESS_TOKEN`:
- Service creation (`create_service`, `create_service_detailed`)
- Service deletion (`delete_service`)
This specification serves as a reference for future IdP API integrations and \
potential expansion of MCP server capabilities.
**Verification:**
- [ ] IdP OpenAPI spec is valid YAML/JSON
- [ ] Spec contains expected Authlete IdP API endpoints
- [ ] No breaking changes in existing endpoint definitions
- [ ] Both YAML and JSON formats are correctly generated
---
🤖 This PR was automatically created by the `update-idp-openapi-spec` GitHub Action.
**Review Guidelines:**
1. Verify the changes are legitimate updates from Authlete IdP
2. Check that service creation/deletion endpoints are preserved
3. Ensure the new version is correctly parsed
4. Consider how this spec could be used for future IdP API tool enhancements
labels: |
dependencies
automation
documentation
idp-api
reviewers: |
watahani
- name: Summary
run: |
if [ "${{ steps.update-spec.outputs.has-changes }}" = "true" ]; then
if [ "${{ steps.existing-pr.outputs.exists }}" = "true" ]; then
echo "ℹ️ IdP spec update matches an existing open PR."
echo "🔁 Reusing branch ${{ steps.branch-info.outputs.branch }}"
else
echo "✅ Authlete IdP OpenAPI spec updated successfully"
echo "📊 Version: ${{ steps.update-spec.outputs.current-version }} → \
${{ steps.update-spec.outputs.new-version }}"
echo "🔧 Paths: ${{ steps.update-spec.outputs.current-paths }} → ${{ steps.update-spec.outputs.new-paths }}"
echo "📋 PR created with refreshed YAML/JSON spec"
echo "🔧 Available for reference in future IdP API integrations"
fi
else
echo "ℹ️ Authlete IdP OpenAPI spec is already up to date"
fi