From 1ec7ebbdb50344d11b1c97162e636faf40c1cbe6 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 27 Sep 2021 06:09:01 -0700 Subject: [PATCH] Create issue on publish failure (#2904) Summary: Because the publish runs aren't triggered on the main branch, we have limited visibility. Sending push notifications, webhooks or email integrations are hard, but opening an issue seems like a decent work-around for this. We can broaden this to more publish actions as needed. Pull Request resolved: https://github.com/facebook/flipper/pull/2904 Test Plan: Ran on my fork which generated this issue: https://github.com/passy/flipper/issues/9 Reviewed By: mweststrate Differential Revision: D31146956 Pulled By: passy fbshipit-source-id: 08f66bd4c96a5ea2cc5e70a7461c30e7e1f3d42e --- .github/action-failure-template.md | 9 +++++++++ .github/workflows/publish-android.yml | 12 +++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 .github/action-failure-template.md diff --git a/.github/action-failure-template.md b/.github/action-failure-template.md new file mode 100644 index 000000000..e3a448f94 --- /dev/null +++ b/.github/action-failure-template.md @@ -0,0 +1,9 @@ +--- +title: GitHub Actions Workflow failed - {{ env.WORKFLOW_NAME }} +assignees: passy +labels: bug +--- + +The workflow {{ env.WORKFLOW_NAME }} failed. You can see it at + +https://github.com/{{ env.REPOSITORY }}/actions/runs/{{ env.RUN_ID }} diff --git a/.github/workflows/publish-android.yml b/.github/workflows/publish-android.yml index dc6bcd245..b3813f0c3 100644 --- a/.github/workflows/publish-android.yml +++ b/.github/workflows/publish-android.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: set up JDK 1.8 uses: actions/setup-java@v1 with: @@ -54,3 +54,13 @@ jobs: with: created_tag: ${{ github.event.inputs.tag }} args: 'SampleApp-android.apk' + - name: Open issue on failure + if: failure() + uses: JasonEtco/create-an-issue@v2.4.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REPOSITORY: ${{ github.repository }} + RUN_ID: ${{ github.run_id }} + WORKFLOW_NAME: "Publish Android" + with: + filename: .github/action-failure-template.md