Template: https://github.com/thodges-gh/CL-EA-NodeJS-Template
githubUser
: The GitHub user trying to registerethAddress
: The ETH address the user wants to connect to
{
"jobRunID": 0,
"data": {
"result": true
},
"result": true,
"statusCode": 200
}
githubUser
: The GitHub user that owns the issue and wants to release its depositsissueId
: The GrapQL node ID of the issue
{
"jobRunID": 0,
"data": {
"result": true
},
"result": true,
"statusCode": 200
}
githubUser
: The GitHub user trying to claim the pull requestprId
: The GrapQL node ID of the pull request
{
"jobRunID": 0,
"data": {
"pullRequest": {
"id": "MDExOlB1bGxSZXF1ZXN0NDc2NTg4Nzg2",
"mergedAt": "2020-09-04T15:24:16Z",
"author": { ... },
"repository": { ... },
"score": 43
},
"result": 43
},
"result": 43,
"statusCode": 200
}
nodeId
: The GitHub GrapQL node IDnodeType
: The GitHub GrapQL node typenodePath
: The GitHub GrapQL node path
{
"jobRunID": 0,
"data": {
"node": {
"repository": {
"stargazers": {
"totalCount": 100
}
},
},
"result": 100
},
"result": 100,
"statusCode": 200
}
GITHUB_APP_ACCESS_TOKEN=...
MAX_PULL_REQUEST_MERGE_AGE=30
Install dependencies:
yarn
Run the local tests:
yarn test
Natively run the application (defaults to port 8080):
yarn start
# register
curl -X POST -H "content-type:application/json" "http://localhost:8080/register" --data '{ "id": 0, "data": { "githubUser": "mktcode", "ethAddress": "0x2771..." } }'
# release
curl -X POST -H "content-type:application/json" "http://localhost:8080/release" --data '{ "id": 0, "data": { "githubUser": "mktcode", "issueId": "MDExOlB..." } }'
# claim
curl -X POST -H "content-type:application/json" "http://localhost:8080/claim" --data '{ "id": 0, "data": { "githubUser": "mktcode", "prId": "MDExOlB..." } }'
# graphql
curl -X POST -H "content-type:application/json" "http://localhost:8080/graphql" --data '{ "id": 0, "data": { "nodeId": "MDExOlB...", "nodeType": "Issue", "nodePath": "repository.stargazers.totalCount" } }'