From ad8ea036ed4d8e57f72917573e93a321459907a7 Mon Sep 17 00:00:00 2001 From: Marc Handalian Date: Tue, 24 Jan 2023 09:40:40 -0700 Subject: [PATCH] Create an issue if an on push gradle check fails. (#5979) * Create an issue if an on push gradle check fails. Signed-off-by: Marc Handalian * Add assignees. Signed-off-by: Marc Handalian Signed-off-by: Marc Handalian --- .github/ISSUE_TEMPLATE/failed_check.md | 9 +++++++++ .github/workflows/gradle-check.yml | 10 ++++++++++ 2 files changed, 19 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/failed_check.md diff --git a/.github/ISSUE_TEMPLATE/failed_check.md b/.github/ISSUE_TEMPLATE/failed_check.md new file mode 100644 index 0000000000000..86d90c2fd0efd --- /dev/null +++ b/.github/ISSUE_TEMPLATE/failed_check.md @@ -0,0 +1,9 @@ +--- +title: Gradle Check Failure. +labels: >test-failure bug +--- + +A gradle check workflow has failed after merge. + +PR: {{ env.workflow_url }} +CommitId: {{ env.pr_from_sha }} diff --git a/.github/workflows/gradle-check.yml b/.github/workflows/gradle-check.yml index 9567bcd63bc2e..2cfcfa8d9d1f9 100644 --- a/.github/workflows/gradle-check.yml +++ b/.github/workflows/gradle-check.yml @@ -16,6 +16,7 @@ jobs: permissions: contents: read # to fetch code (actions/checkout) pull-requests: write # to create or update comment (peter-evans/create-or-update-comment) + issues: write # To create an issue if check fails on push. runs-on: ubuntu-latest timeout-minutes: 130 @@ -123,3 +124,12 @@ jobs: * **CommitID:** ${{ env.pr_from_sha }} Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure [a flaky test](https://github.com/opensearch-project/OpenSearch/blob/main/DEVELOPER_GUIDE.md#flaky-tests) unrelated to your change? + + - name: Create Issue On Push Failure + if: ${{ github.event_name == 'push' && failure() }} + uses: dblock/create-a-github-issue@v3 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + assignees: ${{ github.event.head_commit.author.username }}, ${{ github.triggering_actor }} + filename: .github/ISSUE_TEMPLATE/failed_check.md