File tree Expand file tree Collapse file tree 3 files changed +19
-4
lines changed Expand file tree Collapse file tree 3 files changed +19
-4
lines changed Original file line number Diff line number Diff line change 5353 id : tests
5454 run : |
5555 npm test || npm test || npm test
56- - uses : act10ns/slack@v1
56+ - name : Send status to Slack channel in case of failure
57+ uses : act10ns/slack@v1
5758 with :
5859 status : ${{ job.status }}
5960 steps : ${{ toJson(steps) }}
Original file line number Diff line number Diff line change @@ -51,14 +51,26 @@ jobs:
5151 timeout-minutes : 15
5252 - name : Upload coverage to Codecov
5353 id : upload
54- uses : codecov/codecov-action@v1
54+ uses : codecov/codecov-action@v2
5555 with :
5656 directory : reports/coverage
5757 flags : unittests
5858 fail_ci_if_error : true
59+ - name : Extract coverage value and assign to output
60+ id : extract-coverage
61+ run : |
62+ coverage=`cat reports/coverage/lcov-report/index.html | grep "fraction" | grep -oP '\d+/\d+' | printf %s "$(cat)" | jq -R -s -c 'split("\n")'`
63+ echo "::set-output name=coverage::$coverage"
5964 - uses : act10ns/slack@v1
6065 with :
6166 status : ${{ job.status }}
6267 steps : ${{ toJson(steps) }}
6368 channel : ' #npm-ci'
6469 if : failure()
70+ - name : Send Webhook with status to stdlib backend
71+ uses : distributhor/workflow-webhook@v2
72+ env :
73+ webhook_url : ${{ secrets.STDLIB_COVERAGE_URL }}
74+ webhook_secret : ${{ secrets.STDLIB_WEBHOOK_SECRET }}
75+ data : ' ${{ steps.extract-coverage.outputs.coverage }}'
76+ if : ${{ false }}
Original file line number Diff line number Diff line change 2727 workflow_run :
2828 workflows : ["Publish Package"]
2929 types : [completed]
30+ workflow_dispatch :
3031
3132# Workflow jobs:
3233jobs :
3334 on-success :
3435 runs-on : ubuntu-latest
3536 env :
3637 SLACK_WEBHOOK_URL : ${{ secrets.SLACK_WEBHOOK_URL }}
37- if : ${{ github.event.workflow_run.conclusion == 'success' }}
38+ if : ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
3839 steps :
3940 - uses : actions/checkout@v2
4041 - uses : actions/setup-node@v2
4546 run : |
4647 npm install --only=prod || npm install --only=prod || npm install --only=prod
4748 timeout-minutes : 15
48- - uses : act10ns/slack@v1
49+ - name : Send notification to Slack in case of failure
50+ uses : act10ns/slack@v1
4951 with :
5052 status : ${{ job.status }}
5153 steps : ${{ toJson(steps) }}
You can’t perform that action at this time.
0 commit comments