Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project management automation: Fix 'add milestone' #17157

Merged
merged 1 commit into from Aug 23, 2019

Conversation

@noisysocks
Copy link
Member

commented Aug 23, 2019

Octokit returns all resources wrapped in a data key, e.g. data.milestone instead of milestone. Also, octokit.repos.getContents() returns a base64 encoded string.

(I'm a big idiot who didn't read https://octokit.github.io/rest.js/#usage!)

Confirmed this by using my local Node REPL:

$ node
> let { GitHub } = require( '@actions/github' )
> let octokit = new GitHub( 'INSERT_PERSONAL_ACCESS_TOKEN_HERE' )
> octokit.issues.get( { owner: 'WordPress', repo: 'gutenberg', issue_number: 17156 } ).then( r => result = r )
> result.data.milestone
null
> octokit.repos.getContents( { owner: 'WordPress', repo: 'gutenberg', path: 'package.json' } ).then( r => result = r )
> JSON.parse( Buffer.from( result.data.content, result.data.encoding ).toString() ).version
'6.3.0'
> octokit.issues.listMilestonesForRepo( { owner: 'WordPress', repo: 'gutenberg' } ).then( r => result = r )
> result.data[0].title
'Future'
Octokit returns all resources wrapped in a `data` key, e.g.
`data.milestone` instead of `milestone`. Also,
`octokit.repos.getContents()` returns a base64 encoded string.
@talldan talldan merged commit 2a10279 into master Aug 23, 2019
2 checks passed
2 checks passed
pull-request-automation
Details
Travis CI - Pull Request Build Passed
Details
@talldan talldan deleted the fix/add-milestone branch Aug 23, 2019
donmhico added a commit to donmhico/gutenberg that referenced this pull request Aug 27, 2019
Octokit returns all resources wrapped in a `data` key, e.g.
`data.milestone` instead of `milestone`. Also,
`octokit.repos.getContents()` returns a base64 encoded string.
dratwas added a commit to callstack/gutenberg that referenced this pull request Aug 28, 2019
Octokit returns all resources wrapped in a `data` key, e.g.
`data.milestone` instead of `milestone`. Also,
`octokit.repos.getContents()` returns a base64 encoded string.
gziolo added a commit that referenced this pull request Aug 29, 2019
Octokit returns all resources wrapped in a `data` key, e.g.
`data.milestone` instead of `milestone`. Also,
`octokit.repos.getContents()` returns a base64 encoded string.
gziolo added a commit that referenced this pull request Aug 29, 2019
Octokit returns all resources wrapped in a `data` key, e.g.
`data.milestone` instead of `milestone`. Also,
`octokit.repos.getContents()` returns a base64 encoded string.
dd32 pushed a commit to dd32/gutenberg that referenced this pull request Sep 27, 2019
Octokit returns all resources wrapped in a `data` key, e.g.
`data.milestone` instead of `milestone`. Also,
`octokit.repos.getContents()` returns a base64 encoded string.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.