Skip to content

Commit

Permalink
chore: add github action to generate API index (#654)
Browse files Browse the repository at this point in the history
* chore: add github action to generate API index

* chore: check diff before attempting commit

* chore: update repo target
  • Loading branch information
dwsupplee committed May 14, 2021
1 parent 4bb4b76 commit e252dd5
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/generate_api_index.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit e252dd5

Please sign in to comment.