Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions .github/workflows/librarian_generation_check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,19 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Librarian generate diff check on pull requests
name: Librarian generate diff check
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:
Expand Down Expand Up @@ -66,3 +72,11 @@ jobs:
- name: Check for generated code changes
run: |
git diff --exit-code
- name: Create issue if previous step fails

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering current generate all runs for 1 hour +, If one PR is merged causing generation diff, it's likely subsequent PRs are merged. This will create repeating issues. I think we want to combine them to not over-pollute the issue board.
In fact, I believe we can reuse this action from librarian that already does exactly this. https://github.com/googleapis/librarian/tree/main/.github/actions/create-issue-on-failure

if: ${{ failure() }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh issue create \
--title "Librarian generate diff check failed on main branch" \
--body "The librarian generate diff check failed on main branch. Please check the logs: https://github.com/googleapis/google-cloud-java/actions/runs/${GITHUB_RUN_ID}"
Loading