Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4418551

Browse filesBrowse files
committed
Adds example with use of github object
1 parent e5da67d commit 4418551
Copy full SHA for 4418551

File tree

Expand file treeCollapse file tree

1 file changed

+26
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+26
-0
lines changed

‎README.md

Copy file name to clipboardExpand all lines: README.md
+26Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,29 @@ jobs:
9292
9393
await github.issues.createComment({...context.issue, body: 'Welcome, new contributor!'})
9494
```
95+
96+
### Download data from an URL
97+
98+
You can use the `github` object to access the octokit API. For
99+
instance, `github.request`
100+
101+
```
102+
on:
103+
pull_request
104+
105+
jobs:
106+
diff:
107+
runs-on: ubuntu-latest
108+
steps:
109+
- uses: actions/github-script@0.2.0
110+
with:
111+
github-token: ${{github.token}}
112+
script: |
113+
const diff_url = context.payload.pull_request.diff_url
114+
const result = await github.request( diff_url )
115+
console.log( result )
116+
117+
```
118+
119+
This will print the full diff object in the screen; `result.data` will
120+
contain the actual diff text.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.