Merge pull request from GHSA-cq9g-c286-6ch7
* create a reusable workflow for current error reporting logic * make github.event.head_commit.message as a env, COMMIT_MESSAGE * make github.event.head_commit.author.name as a env, COMMIT_AUTHOR_NAME * remove redundant name * replace error reporting step with the reusalble workflow
This commit is contained in:
parent
45291a5001
commit
a665d679cc
|
@ -68,18 +68,6 @@ jobs:
|
||||||
- android
|
- android
|
||||||
- ios
|
- ios
|
||||||
if: failure() && github.event_name == 'push'
|
if: failure() && github.event_name == 'push'
|
||||||
runs-on: ubuntu-20.04
|
uses: ./.github/workflows/error-reporting.yml
|
||||||
steps:
|
secrets:
|
||||||
- name: Slack
|
WEBHOOK: ${{ secrets.SLACK_ERROR_REPORTING_WEBHOOK }}
|
||||||
run: |
|
|
||||||
curl -H "Content-Type: application/json" \
|
|
||||||
-X POST ${{ secrets.SLACK_ERROR_REPORTING_WEBHOOK }} \
|
|
||||||
-d '{
|
|
||||||
"attachments": [
|
|
||||||
{
|
|
||||||
"color": "#AC514C",
|
|
||||||
"text":
|
|
||||||
"*${{ github.repository }} (${{ github.workflow }})*\n${{ github.event.head_commit.message }} - _${{ github.event.head_commit.author.name }}_\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Build>",
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}'
|
|
||||||
|
|
|
@ -93,18 +93,6 @@ jobs:
|
||||||
- check
|
- check
|
||||||
- build_and_deploy
|
- build_and_deploy
|
||||||
if: failure() && github.event_name == 'push'
|
if: failure() && github.event_name == 'push'
|
||||||
runs-on: ubuntu-20.04
|
uses: ./.github/workflows/error-reporting.yml
|
||||||
steps:
|
secrets:
|
||||||
- name: Slack
|
WEBHOOK: ${{ secrets.SLACK_ERROR_REPORTING_WEBHOOK }}
|
||||||
run: |
|
|
||||||
curl -H "Content-Type: application/json" \
|
|
||||||
-X POST ${{ secrets.SLACK_ERROR_REPORTING_WEBHOOK }} \
|
|
||||||
-d '{
|
|
||||||
"attachments": [
|
|
||||||
{
|
|
||||||
"color": "#AC514C",
|
|
||||||
"text":
|
|
||||||
"*${{ github.repository }} (${{ github.workflow }})*\n${{ github.event.head_commit.message }} - _${{ github.event.head_commit.author.name }}_\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Build>",
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}'
|
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
name: error-reporting
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
secrets:
|
||||||
|
WEBHOOK:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
slack:
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
steps:
|
||||||
|
- env:
|
||||||
|
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
|
||||||
|
COMMIT_AUTHOR_NAME: ${{ github.event.head_commit.author.name }}
|
||||||
|
run: |
|
||||||
|
curl -H "Content-Type: application/json" \
|
||||||
|
-X POST ${{ secrets.WEBHOOK }} \
|
||||||
|
-d '{
|
||||||
|
"attachments": [
|
||||||
|
{
|
||||||
|
"color": "#AC514C",
|
||||||
|
"text":
|
||||||
|
"*${{ github.repository }} (${{ github.workflow }})*\n'"$COMMIT_MESSAGE"' - _'"$COMMIT_AUTHOR_NAME"'_\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Build>",
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}'
|
|
@ -30,18 +30,6 @@ jobs:
|
||||||
needs:
|
needs:
|
||||||
- web3
|
- web3
|
||||||
if: failure() && github.event_name == 'push'
|
if: failure() && github.event_name == 'push'
|
||||||
runs-on: ubuntu-20.04
|
uses: ./.github/workflows/error-reporting.yml
|
||||||
steps:
|
secrets:
|
||||||
- name: Slack
|
WEBHOOK: ${{ secrets.SLACK_ERROR_REPORTING_WEBHOOK }}
|
||||||
run: |
|
|
||||||
curl -H "Content-Type: application/json" \
|
|
||||||
-X POST ${{ secrets.SLACK_ERROR_REPORTING_WEBHOOK }} \
|
|
||||||
-d '{
|
|
||||||
"attachments": [
|
|
||||||
{
|
|
||||||
"color": "#AC514C",
|
|
||||||
"text":
|
|
||||||
"*${{ github.repository }} (${{ github.workflow }})*\n${{ github.event.head_commit.message }} - _${{ github.event.head_commit.author.name }}_\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Build>",
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}'
|
|
||||||
|
|
|
@ -22,18 +22,6 @@ jobs:
|
||||||
needs:
|
needs:
|
||||||
- release-artifacts
|
- release-artifacts
|
||||||
if: failure() && github.event_name == 'push'
|
if: failure() && github.event_name == 'push'
|
||||||
runs-on: ubuntu-20.04
|
uses: ./.github/workflows/error-reporting.yml
|
||||||
steps:
|
secrets:
|
||||||
- name: Slack
|
WEBHOOK: ${{ secrets.SLACK_ERROR_REPORTING_WEBHOOK }}
|
||||||
run: |
|
|
||||||
curl -H "Content-Type: application/json" \
|
|
||||||
-X POST ${{ secrets.SLACK_ERROR_REPORTING_WEBHOOK }} \
|
|
||||||
-d '{
|
|
||||||
"attachments": [
|
|
||||||
{
|
|
||||||
"color": "#AC514C",
|
|
||||||
"text":
|
|
||||||
"*${{ github.repository }} (${{ github.workflow }})*\n${{ github.event.head_commit.message }} - _${{ github.event.head_commit.author.name }}_\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Build>",
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}'
|
|
||||||
|
|
Loading…
Reference in New Issue