auths
objectreturn
or this.key = 'value'
, pass input data to your code viaparams
, and maintain state across executions with$checkpoint.async
(event, steps) => {
}
const faker = require('faker')
return faker.commerce.productName()
The title of the issue.
Name of repository owner.
Name of repository.
async
(params, auths) => {
}
//See the API docs here: https://developer.github.com/v3/issues/#create-an-issue
const data = {
assignee: params.assignee,
body: params.body,
labels: params.labels,
milestone: params.milestone,
title: params.title,
}
const config = {
method: "post",
url: `https://api.github.com/repos/${params.owner}/${params.repo}/issues`,
headers: {
Authorization: `Bearer ${auths.github.oauth_access_token}`,
},
data,
}
return await require("@pipedreamhq/platform").axios(this, config)
auths
objectName of repository owner.
Name of repository.
return
or this.key = 'value'
, pass input data to your code viaparams
, and maintain state across executions with$checkpoint.async
(event, steps, params, auths) => {
}
//See the API docs here: https://developer.github.com/v3/issues/#list-issues-for-a-repository
const config = {
url: `https://api.github.com/repos/${params.owner}/${params.repo}/issues`,
params: {
state: params.state,
labels: params.labels,
sort: params.sort,
direction: params.direction,
since: params.since,
milestone: params.milestone,
creator: params.creator,
mentioned: params.mentioned,
assignee: params.assignee,
per_page: 100
},
headers: {
Authorization: `Bearer ${auths.github.oauth_access_token}`,
},
}
return await require("@pipedreamhq/platform").axios(this, config)
auths
objectreturn
or this.key = 'value'
, pass input data to your code viaparams
, and maintain state across executions with$checkpoint.async
(event, steps) => {
}
return steps.get_repo_issues.$return_value.slice(10)
auths
objectreturn
or this.key = 'value'
, pass input data to your code viaparams
, and maintain state across executions with$checkpoint.async
(event, steps, auths) => {
}
const axios = require('axios')
const data = steps.issues_to_delete.$return_value
const deletions = []
for (let i = 0; i < data.length; i++) {
let result = await axios({
url: `https://api.github.com/graphql`,
method: 'post',
headers: {
Authorization: `Bearer ${auths.github.oauth_access_token}`,
},
data: { "query": `mutation DeleteIssue {
deleteIssue(input:{issueId:"${data[i].node_id}"}) {
clientMutationId
}
}`
}
})
deletions.push(result.data)
}
return deletions