Skip to content

Commit 498bd19

Browse files
authored
chore: add github action to generate API index (#650)
* chore: add github action to generate API index * chore: check diff before attempting commit * chore: update repo target
1 parent 4e3e319 commit 498bd19

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Generate API Index
2+
on:
3+
push:
4+
branches: [master]
5+
workflow_dispatch:
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Setup .NET Core SDK
11+
uses: actions/[email protected]
12+
- name: Checkout googleapis (this repository)
13+
uses: actions/checkout@v2
14+
- name: Checkout index generator
15+
uses: actions/checkout@v2
16+
with:
17+
repository: googleapis/googleapis-api-index-generator
18+
path: gen
19+
- name: Generate API index
20+
run: |
21+
gen/scripts/generate-schema.sh
22+
gen/scripts/generate-index.sh $PWD
23+
cp gen/tmp/api-index-v1.json $PWD
24+
- name: Commit API index
25+
run: |
26+
[[ ! $(git diff --exit-code api-index-v1.json) ]] && echo "Nothing to commit." && exit 0
27+
git config user.name "Google APIs"
28+
git add api-index-v1.json
29+
git commit -m "chore: regenerate API index"
30+
git push

0 commit comments

Comments
 (0)