-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |