File tree Expand file tree Collapse file tree 4 files changed +387
-6
lines changed Expand file tree Collapse file tree 4 files changed +387
-6
lines changed Original file line number Diff line number Diff line change
1
+ /* eslint-disable no-console */
2
+ const JSDOM = require ( 'jsdom' ) . JSDOM
3
+
4
+ const [ html ] = process . argv . slice ( 2 )
5
+ const { document } = new JSDOM ( html ) . window
6
+
7
+ const linkElement = document . querySelector ( 'a' )
8
+ console . log ( linkElement ?. href ? linkElement . href . replace ( / [ / ] $ / , '' ) : '' )
Original file line number Diff line number Diff line change
1
+ name : Cloudflare Pages Deployed
2
+
3
+ on :
4
+ check_run :
5
+ types : [completed]
6
+
7
+ # only run test with latest commit
8
+ concurrency :
9
+ group : ${{ github.workflow }}-${{ github.ref }}
10
+ cancel-in-progress : true
11
+
12
+ jobs :
13
+ build :
14
+ name : Test
15
+ runs-on : ubuntu-latest
16
+ if : github.event.check_run.pull_requests[0]
17
+
18
+ steps :
19
+ - uses : actions/checkout@v3
20
+ - uses : actions/setup-node@v3
21
+ with :
22
+ node-version : ' 16.x'
23
+ cache : ' yarn'
24
+
25
+ - name : Set testing state
26
+ uses : thollander/actions-comment-pull-request@v1
27
+ with :
28
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
29
+ pr_number : ${{ github.event.check_run.pull_requests[0].number }}
30
+ comment_includes : ' Playwright tests'
31
+ message : |
32
+ ## Playwright tests
33
+ testing...
34
+
35
+ - name : Install dependencies
36
+ run : yarn install
37
+
38
+ - name : Check object
39
+ run : |
40
+ cat << OBJECT
41
+ ${{ toJson(github) }}
42
+ OBJECT
43
+ - name : Get Cloudflare Page URL
44
+ id : get_url
45
+ run : |
46
+ DEPLOYMENT_URL=$(node ${GITHUB_WORKSPACE}/.github/get-cloudflare-page-url.js "${{ github.event.check_run.output.summary }}")
47
+ echo $DEPLOYMENT_URL
48
+ echo "::set-output name=url::$DEPLOYMENT_URL"
49
+ - run : echo ${{ steps.get_url.outputs.url }}
50
+ - run : echo $DEPLOYMENT_URL
Original file line number Diff line number Diff line change 39
39
"vuepress" : " ^1.2.0"
40
40
},
41
41
"dependencies" : {
42
+ "jsdom" : " ^20.0.0" ,
42
43
"vuepress-theme-sidstraw-blog" : " file:./.vuepress/theme" ,
43
44
"yaml" : " ^1.10.0"
44
45
}
You can’t perform that action at this time.
0 commit comments