Skip to content

Commit 2512845

Browse files
committed
chore: change to post submit and create an issue on failure
1 parent 8183d08 commit 2512845

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

.github/workflows/librarian_generation_check.yaml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,19 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
name: Librarian generate diff check on pull requests
14+
name: Librarian generate diff check
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:
@@ -66,3 +72,11 @@ jobs:
6672
- name: Check for generated code changes
6773
run: |
6874
git diff --exit-code
75+
- name: Create issue if previous step fails
76+
if: ${{ failure() }}
77+
env:
78+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
79+
run: |
80+
gh issue create \
81+
--title "Librarian generate diff check failed on main branch" \
82+
--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}"

0 commit comments

Comments
 (0)