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
Merged

Conversation

noisysocks
Copy link
Member

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.
@noisysocks noisysocks added the [Type] Project Management Meta-issues related to project management of Gutenberg label Aug 23, 2019
@noisysocks noisysocks requested a review from talldan August 23, 2019 04:48
@talldan talldan merged commit 2a10279 into master Aug 23, 2019
@talldan talldan deleted the fix/add-milestone branch August 23, 2019 05:49
@noisysocks noisysocks added the [Type] Bug An existing feature does not function as intended label Aug 25, 2019
donmhico pushed 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.
gziolo pushed 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 pushed 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature does not function as intended [Type] Project Management Meta-issues related to project management of Gutenberg
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants