Skip to content

Commit 81642fe

Browse files
committed
Add log for data
1 parent 1ac0218 commit 81642fe

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

.github/workflows/commit-context.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
branches:
66
- main
77
- dev
8+
- debug
89

910
jobs:
1011
get-commit-info:

src/main.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,24 @@ export async function run(): Promise<void> {
1010
try {
1111
// const repository: string = core.getInput('sourceRepo')
1212
const token = core.getInput('github_token', { required: true })
13+
// const apicuron_token = core.getInput('apicuron_token', { required: true })
1314
const octokit = github.getOctokit(token)
1415
const sha = github.context.sha
1516
const { owner, repo } = github.context.repo
16-
const { data: commit } = await octokit.rest.repos.getCommit({
17+
18+
const data = await octokit.rest.repos.getCommit({
1719
owner,
1820
repo,
1921
ref: sha
2022
})
21-
console.log(`Commit Message: ${commit.commit.message}`)
22-
console.log(`Author Name: ${commit.commit.author?.name}`)
23-
console.log(`Author Email: ${commit.commit.author?.email}`)
24-
console.log(`Committer Name: ${commit.commit.committer?.name}`)
25-
console.log(`Committer Email: ${commit.commit.committer?.email}`)
23+
// add orcid
24+
// send to apicuron
25+
console.log(JSON.stringify(data, null, 2))
26+
// console.log(`Commit Message: ${commit.commit.message}`)
27+
// console.log(`Author Name: ${commit.commit.author?.name}`)
28+
// console.log(`Author Email: ${commit.commit.author?.email}`)
29+
// console.log(`Committer Name: ${commit.commit.committer?.name}`)
30+
// console.log(`Committer Email: ${commit.commit.committer?.email}`)
2631
} catch (error) {
2732
if (error instanceof Error) core.setFailed(error.message)
2833
}

0 commit comments

Comments
 (0)