Skip to content

Commit 16baf70

Browse files
committed
feat(apis): fetch and update Google APIs list
Replaces the manually maintained list of Google APIs with a script that fetches the latest data directly from the Google API Discovery Service. This ensures that the API and scope information is always up-to-date, reduces manual maintenance effort, and provides more comprehensive data for each API. - Adds a `fetch-apis` script to automate data retrieval. - Introduces `googleapis`, `ky`, and `tsx` as development dependencies. - Updates the internal data structure for APIs to align with the discovery service output. - Adjusts build and test configurations to support the new workflow.
1 parent df284d3 commit 16baf70

File tree

11 files changed

+1073
-4641
lines changed

11 files changed

+1073
-4641
lines changed

.changeset/odd-insects-tap.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"google-workspace-developer-tools": patch
3+
---
4+
5+
Automatically fetch APIs via Discovery Service

.github/workflows/update-apis.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: Update APIs
16+
on:
17+
schedule:
18+
- cron: "0 0 * * *" # Runs every day at midnight
19+
workflow_dispatch: # Allows manual triggering
20+
jobs:
21+
update-apis:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
25+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
26+
- run: npm ci
27+
- run: npm run fetch-apis
28+
- name: Check for changes
29+
id: changes
30+
uses: tj-actions/changed-files@24d32ffd492484c1d75e0c0b894501ddb9d30d62 # v47.0.0
31+
with:
32+
files: src/apis.ts
33+
- name: Create Changeset
34+
if: steps.changes.outputs.any_changed == 'true'
35+
run: |
36+
cat <<EOF > .changeset/update-apis.md
37+
---
38+
"google-workspace-developer-tools": patch
39+
---
40+
41+
Update APIs and scopes via the Discovery service
42+
EOF
43+
- name: Create Pull Request
44+
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
45+
if: steps.changes.outputs.any_changed == 'true'
46+
with:
47+
token: ${{ secrets.GITHUB_TOKEN }}
48+
commit-message: "fix: update APIs via Discovery service"
49+
title: "fix: update APIs via discovery service"
50+
body: "This PR updates the APIs based on the latest Discovery documents."
51+
branch: "update-apis"
52+
delete-branch: true

.vscode-test.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@
1717
import { defineConfig } from "@vscode/test-cli";
1818

1919
export default defineConfig({
20-
files: "out/test/**/*.test.js",
20+
files: "out/test/**/*.test.cjs",
2121
});

0 commit comments

Comments
 (0)