-
-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (35 loc) · 1.33 KB
/
check-dist-failed.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: check-dist-failed
on:
workflow_run:
workflows: [ check-dist ]
types: [ completed ]
permissions:
pull-requests: read
jobs:
comment:
if: |
github.event.workflow_run.conclusion == 'failure' &&
github.event.workflow_run.event == 'pull_request'
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Add comment
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
const { owner, repo } = context.repo;
const { data: prs } = await github.rest.repos.listPullRequestsAssociatedWithCommit({
owner,
repo,
commit_sha: context.payload.workflow_run.head_sha,
});
if (prs.length > 0) {
const pr = prs[0];
await github.rest.issues.createComment({
owner,
repo,
issue_number: pr.number,
body: `Hi @${pr.user.login} :wave:\n\nIt looks like this pull request makes changes which require the contents of \`dist\` to be updated, but these files have not been included with your changes.\n\nPlease run \`build.ps1\` and commit the changes made to the \`dist\` directory to your branch and push them to this pull request.`,
});
}