-
Notifications
You must be signed in to change notification settings - Fork 86
71 lines (59 loc) · 2.43 KB
/
test_url.yaml
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
---
name: Add message on pull requests with the related examples
on:
pull_request_target:
types:
- opened
jobs:
all:
name: Add message on pull requests with the related examples
runs-on: ubuntu-22.04
timeout-minutes: 2
steps:
- run: npm install --production @actions/github
- run: |
echo "
const github = require('@actions/github');
async function run() {
// Get client and context
const client = new github.getOctokit(process.env.GITHUB_TOKEN);
await client.rest.pulls.createReview({
owner: github.context.issue.owner,
repo: github.context.issue.repo,
pull_number: github.context.issue.number,
body: [
\`Examples: https://camptocamp.github.io/ngeo/\${process.env.GITHUB_HEAD_REF}/examples/\`,
\`Storybook: https://camptocamp.github.io/ngeo/\${process.env.GITHUB_HEAD_REF}/storybook/\`,
\`API help: https://camptocamp.github.io/ngeo/\${process.env.GITHUB_HEAD_REF}/api/apihelp/apihelp.html\`,
\`API documentation: https://camptocamp.github.io/ngeo/\${process.env.GITHUB_HEAD_REF}/apidoc/\`,
].join('\n'),
event: 'COMMENT'
});
}
run();
" > pr-message.js
if: github.actor != 'dependabot[bot]'
- run: |
echo "
const github = require('@actions/github');
async function run() {
// Get client and context
const client = new github.getOctokit(process.env.GITHUB_TOKEN);
await client.rest.pulls.createReview({
owner: github.context.issue.owner,
repo: github.context.issue.repo,
pull_number: github.context.issue.number,
body: [
\"This build can't have the Chromatic status because the secrets are missing.\",
\"To get the Chromatic status check you should assign one label, e.-g. \`get-chromatic-on-dependabot\`.\",
\"You can also check the status on https://www.chromatic.com/pullrequests?appId=612f928164063b003a629e5b.\"
].join('\n'),
event: 'COMMENT'
});
}
run();
" > pr-message.js
if: github.actor == 'dependabot[bot]'
- run: node pr-message.js
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}