googleapis/.github/workflows/generate_api_index.yaml
Google APIs baba7394f5 fix: Don't include generator test protos in the API index.
Keep `googleapis` and `googleapis-api-index-generator` separate when generating the API index.

The index generator recurses down the directory structure... which means that test files in the generator's `test` directory are ending up being treated as APIs with a directory path of `gen/test/...`

Fixes https://github.com/googleapis/googleapis-api-index-generator/issues/18

Committer: @jskeet
PiperOrigin-RevId: 387371705
2021-07-28 09:49:46 -07:00

33 lines
1,020 B
YAML

name: Generate API Index
on: # yamllint disable-line rule:truthy
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
with:
path: googleapis
- 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/googleapis
cp gen/tmp/api-index-v1.json $PWD/googleapis
- name: Commit API index
run: |
cd googleapis
[[ ! $(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