diff --git a/.github/workflows/librarian_generation_check.yaml b/.github/workflows/librarian_generation_check.yaml index 4e0d5ef5ff3d..d285b58de898 100644 --- a/.github/workflows/librarian_generation_check.yaml +++ b/.github/workflows/librarian_generation_check.yaml @@ -13,11 +13,17 @@ # limitations under the License. name: Librarian - Generate diff check on pull requests on: - pull_request: + push: + branches: + - main + workflow_dispatch: jobs: library_generation: runs-on: ubuntu-24.04 + permissions: + contents: read + issues: write steps: - uses: actions/checkout@v4 with: @@ -70,3 +76,12 @@ jobs: echo "Regeneration produced code changes! Please run 'librarian generate --all' to update the generated files." exit 1 fi + - name: Create issue if previous step fails + if: ${{ failure() && github.ref == 'refs/heads/main' }} + uses: googleapis/librarian/.github/actions/create-issue-on-failure@main + with: + title: "Librarian generate diff check failed on main branch" + body: | + The librarian generate diff check failed on main branch. + + Please check the logs: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}