• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1name: Generate API Index
2on:  # yamllint disable-line rule:truthy
3  push:
4    branches: [master]
5  workflow_dispatch:
6jobs:
7  build:
8    runs-on: ubuntu-latest
9    steps:
10    - name: Setup .NET Core SDK
11      uses: actions/setup-dotnet@v3
12    - name: Checkout googleapis (this repository)
13      uses: actions/checkout@v3
14      with:
15        path: googleapis
16    - name: Checkout index generator
17      uses: actions/checkout@v3
18      with:
19        repository: googleapis/googleapis-api-index-generator
20        path: gen
21    - name: Generate API index
22      run: |
23        gen/scripts/generate-schema.sh
24        gen/scripts/generate-index.sh $PWD/googleapis
25        cp gen/tmp/api-index-v1.json $PWD/googleapis
26    - name: Commit API index
27      run: |
28        cd googleapis
29        [[ ! $(git diff --exit-code api-index-v1.json) ]] && echo "Nothing to commit." && exit 0
30        git config user.name "Google APIs"
31        git add api-index-v1.json
32        git commit -m "chore: regenerate API index"
33        git push
34