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 targetpull/655/head
parent
4bb4b761e4
commit
e252dd5936
1 changed files with 30 additions and 0 deletions
@ -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…
Reference in new issue