-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathcommits.js
More file actions
38 lines (28 loc) · 748 Bytes
/
commits.js
File metadata and controls
38 lines (28 loc) · 748 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
# Commits features
## Setup
```javascript
const GitHubClient = require('../libs/GitHubClient.js').GitHubClient;
const commits = require('../libs/features/commits');
let githubCli = new GitHubClient({
baseUri: "http://github.at.home/api/v3",
token: process.env.TOKEN_GHITHUB_ENTERPRISE
}, commits); //<-- add commits features
```
*/
/*
## fetchCommitBySHA
- parameter: `sha, owner, repository`
- return: `Promise`
### Description
`fetchCommitBySHA` gets a commit by its sha
*/
function fetchCommitBySHA({sha, owner, repository}){
return this.getData({path:`/repos/${owner}/${repository}/git/commits/${sha}`})
.then(response => {
return response.data;
});
}
module.exports = {
fetchCommitBySHA: fetchCommitBySHA
};