-
-
Notifications
You must be signed in to change notification settings - Fork 77
63 lines (62 loc) · 2.19 KB
/
selenology.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Selenology
on:
workflow_dispatch:
inputs:
prId:
description: 'PR #'
required: true
jobs:
selenology:
runs-on: ubuntu-latest
steps:
- name: Get PR info
uses: octokit/[email protected]
id: get_pr_info
with:
query: |
query getPullRequestInfo($owner:String!,$repo:String!,$number:Int!) {
repository(owner: $owner, name: $repo) {
pullRequest(number:$number) {
headRepository {
url
}
headRefOid
}
}
}
owner: ${{ github.event.repository.owner.login }}
repo: ${{ github.event.repository.name }}
number: ${{ github.event.inputs.prId }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run selenology
id: selenology
uses: Kampfkarren/selenology@main
with:
new_selene_checkout: ${{ fromJSON(steps.get_pr_info.outputs.data).repository.pullRequest.headRefOid }}
new_selene_repository: ${{ fromJSON(steps.get_pr_info.outputs.data).repository.pullRequest.headRepository.url }}
- uses: actions/checkout@v2
with:
ref: selenology-outputs
path: selenology-outputs
- name: Upload output
id: upload
run: |
cd $GITHUB_WORKSPACE/selenology-outputs
FILENAME=selenology-outputs/output-$(date +%s).html
mkdir -p selenology-outputs
cat <<'EOF' >>$FILENAME
${{ steps.selenology.outputs.output }}
EOF
git config user.name "Selenology"
git config user.email "<>"
git add selenology-outputs/
git commit -m "Add selenology outputs."
git push origin selenology-outputs
echo "::set-output name=filename::$FILENAME"
- name: Post comment
uses: peter-evans/create-or-update-comment@v1
with:
issue-number: ${{ github.event.inputs.prId }}
body: |
Selenology report was created, and can be viewed [at this link](https://htmlpreview.github.io/?https://github.com/${{ github.event.repository.owner.login }}/${{ github.event.repository.name }}/blob/selenology-outputs/${{ steps.upload.outputs.filename }}).