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
This commit is contained in:
Pascal Hartig
2021-09-27 06:09:01 -07:00
committed by Facebook GitHub Bot
parent 8ec91ac16c
commit 1ec7ebbdb5
2 changed files with 20 additions and 1 deletions

9
.github/action-failure-template.md vendored Normal file
View File

@@ -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 }}

View File

@@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v2
- name: set up JDK 1.8 - name: set up JDK 1.8
uses: actions/setup-java@v1 uses: actions/setup-java@v1
with: with:
@@ -54,3 +54,13 @@ jobs:
with: with:
created_tag: ${{ github.event.inputs.tag }} created_tag: ${{ github.event.inputs.tag }}
args: 'SampleApp-android.apk' 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