chore: add github action to generate API index (#654)

* chore: add github action to generate API index

* chore: check diff before attempting commit

* chore: update repo target
pull/655/head
David Supplee 4 years ago committed by GitHub
parent 4bb4b761e4
commit e252dd5936
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 30
      .github/workflows/generate_api_index.yaml

@ -0,0 +1,30 @@
name: Generate API Index
on:
push:
branches: [master]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v1.8.0
- name: Checkout googleapis (this repository)
uses: actions/checkout@v2
- name: Checkout index generator
uses: actions/checkout@v2
with:
repository: googleapis/googleapis-api-index-generator
path: gen
- name: Generate API index
run: |
gen/scripts/generate-schema.sh
gen/scripts/generate-index.sh $PWD
cp gen/tmp/api-index-v1.json $PWD
- name: Commit API index
run: |
[[ ! $(git diff --exit-code api-index-v1.json) ]] && echo "Nothing to commit." && exit 0
git config user.name "Google APIs"
git add api-index-v1.json
git commit -m "chore: regenerate API index"
git push
Loading…
Cancel
Save