Skip to content

Commit 15b219b

Browse files
zhumin8sofisl
andauthored
chore: change to post submit and create an issue on failure (#13422)
Converts this check to post submit and creates issue on failure. Uses create-issue-on-failure action from librarian, so that created issue is labeled and assigned, and subsequent failures will only add comment to the same issue. Verified create issue flow via temp changes [2a20071](2a20071), see sample issue created: #13421. Fixes googleapis/librarian#5240 --------- Co-authored-by: Sofia Leon <sofialeon@google.com> Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com>
1 parent 78854bc commit 15b219b

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

.github/workflows/librarian_generation_check.yaml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,17 @@
1313
# limitations under the License.
1414
name: Librarian - Generate diff check on pull requests
1515
on:
16-
pull_request:
16+
push:
17+
branches:
18+
- main
19+
workflow_dispatch:
1720

1821
jobs:
1922
library_generation:
2023
runs-on: ubuntu-24.04
24+
permissions:
25+
contents: read
26+
issues: write
2127
steps:
2228
- uses: actions/checkout@v4
2329
with:
@@ -70,3 +76,12 @@ jobs:
7076
echo "Regeneration produced code changes! Please run 'librarian generate --all' to update the generated files."
7177
exit 1
7278
fi
79+
- name: Create issue if previous step fails
80+
if: ${{ failure() && github.ref == 'refs/heads/main' }}
81+
uses: googleapis/librarian/.github/actions/create-issue-on-failure@main
82+
with:
83+
title: "Librarian generate diff check failed on main branch"
84+
body: |
85+
The librarian generate diff check failed on main branch.
86+
87+
Please check the logs: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}

0 commit comments

Comments
 (0)