mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-09-12 09:37:29 +08:00
Add failed PR comment job (#3808) Bruception
* Add failed PR comment job * test * . * test * Download workflow artifact * . * test * . * test * nice * Fix typo
This commit is contained in:
parent
cb8237a0c0
commit
89fa7dc25d
2 changed files with 18 additions and 38 deletions
38
.github/workflows/comment-failed-pr.yml
vendored
38
.github/workflows/comment-failed-pr.yml
vendored
|
@ -1,38 +0,0 @@
|
|||
name: Comment on failed PR
|
||||
permissions:
|
||||
pull-requests: write
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: [PR Check]
|
||||
types: [completed]
|
||||
|
||||
jobs:
|
||||
on-failure:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
|
||||
steps:
|
||||
- name: Download workflow artifact
|
||||
uses: dawidd6/action-download-artifact@v2.11.0
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
workflow: peek_icons.yml
|
||||
run_id: ${{ github.event.workflow_run.id }}
|
||||
|
||||
- name: Read the pr_num file
|
||||
id: pr_num_reader
|
||||
uses: juliangruber/read-file-action@v1.0.0
|
||||
with:
|
||||
path: ./pr_num/pr_num.txt
|
||||
|
||||
- name: Create comment
|
||||
uses: actions/github-script@v5
|
||||
with:
|
||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||
script: |
|
||||
github.rest.issues.createComment({
|
||||
issue_number: ${{ steps.pr_num_reader.outputs.content }},
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body: 'The PR check action failed. Please review the logs and make the necessary changes. ' + context.payload.workflow_run.html_url
|
||||
})
|
18
.github/workflows/monkey-ci.yml
vendored
18
.github/workflows/monkey-ci.yml
vendored
|
@ -146,3 +146,21 @@ jobs:
|
|||
- name: Validate other JSON
|
||||
if: steps.filter.outputs.other-json == 'true'
|
||||
run: npm run pr-check-other-json
|
||||
|
||||
on-failure:
|
||||
name: on-failure
|
||||
runs-on: ubuntu-latest
|
||||
needs: [ci-be, ci-fe, ci-assets]
|
||||
if: ${{ always() && contains(needs.*.result, 'failure') && github.ref != 'refs/heads/master' }}
|
||||
steps:
|
||||
- name: Comment on PR
|
||||
uses: actions/github-script@v5
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
github.rest.issues.createComment({
|
||||
issue_number: ${{ github.event.number }},
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body: 'Continuous integration check(s) failed. Please review the failing check\'s logs and make the necessary changes. ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'
|
||||
})
|
||||
|
|
Loading…
Add table
Reference in a new issue