forked from actions/github-script
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (45 loc) · 1.39 KB
/
test.yml
File metadata and controls
51 lines (45 loc) · 1.39 KB
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
on:
pull_request: {branches: master}
push: {branches: master}
repository_dispatch:
name: Test
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- id: run-script
uses: ./
with:
github-token: ${{secrets.GITHUB_TOKEN}}
result-encoding: string
script: |
const crypto = require('crypto')
const {promisify} = require('util')
const randomBytes = promisify(crypto.randomBytes)
const repo = await github.repos.get({
owner: 'actions',
repo: 'github-script'
})
setTimeout(() => console.log("HI"), 0)
console.log('repo.url', repo.url)
console.log('context.eventName', context.eventName)
console.log('input.result-encoding', actions.core.getInput('result-encoding'))
const bytes = await randomBytes(16)
return bytes.toString('hex')
- uses: ./
name: Invalid token
continue-on-error: true
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
#
- uses: ./
name: Throw error
continue-on-error: true
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
throw new Error('Whoops!')
- run: |
echo OUTPUT: ${{steps.run-script.outputs.result}}