Skip to content

Commit a0affc6

Browse files
authored
chore: use github API library list in README.rst (googleapis#10551)
* chore: use github API library list in README.rst * exclude archived repos * Update api index * use the HTTP links header to terminate the request loop * use github action instead of autosynth * add test code * remove test code
1 parent 5a685d4 commit a0affc6

File tree

4 files changed

+341
-99
lines changed

4 files changed

+341
-99
lines changed

.github/main.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Copyright 2021 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+
# https://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: A workflow for updating the api index in README.rst
16+
# Controls when the action will run.
17+
18+
on:
19+
schedule:
20+
# * is a special character in YAML so you have to quote this string
21+
# Run this Github Action every Tuesday at 7 AM UTC
22+
- cron: '0 7 * * 2'
23+
24+
jobs:
25+
build:
26+
name: Update API Index PR
27+
runs-on: ubuntu-latest
28+
# don't run the workflow on forks of googleapis/google-cloud-python
29+
if: ${{github.repository == 'googleapis/google-cloud-python'}}
30+
steps:
31+
- name: Get current date
32+
id: date
33+
run: echo "::set-output name=current_date::$(date +'%Y-%m-%d')"
34+
- uses: actions/checkout@v2
35+
- name: Set up Python 3.9
36+
uses: actions/setup-python@v2
37+
with:
38+
python-version: 3.9
39+
- name: Run python script to update the api index in README.rst
40+
run: python3 updateapiindex.py
41+
working-directory: ./scripts
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
- uses: googleapis/code-suggester@v2
45+
env:
46+
ACCESS_TOKEN: ${{ secrets.YOSHI_CODE_BOT_TOKEN }}
47+
with:
48+
command: pr
49+
force: true
50+
upstream_owner: googleapis
51+
upstream_repo: google-cloud-python
52+
description: 'Update the list of available APIs in the README.'
53+
title: 'docs: update the list of available APIs'
54+
message: 'docs: update the list of available APIs'
55+
branch: update-api-list-${{ steps.date.outputs.current_date }}
56+
git_dir: '.'

0 commit comments

Comments
 (0)