Skip to content

Commit 31865d5

Browse files
committed
feat: add event input to commit context workflow and enable no-unused-vars rule in ESLint
1 parent 2e774e8 commit 31865d5

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

.github/workflows/commit-context.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ jobs:
1919
with:
2020
github_token: ${{ secrets.GITHUB_TOKEN }}
2121
sourceRep: ${{ github.repository }}
22+
event: ${{ github.event }}

eslint.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export default [
7474
'import/no-namespace': 'off',
7575
'no-console': 'off',
7676
'no-shadow': 'off',
77-
'no-unused-vars': 'off',
77+
'no-unused-vars': 'on',
7878
'prettier/prettier': 'error'
7979
}
8080
}

src/main.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,22 @@ import * as github from '@actions/github'
88
*/
99
export async function run(): Promise<void> {
1010
try {
11+
const event = core.getInput('event')
12+
console.log(JSON.stringify(event, null, 2))
1113
// const repository: string = core.getInput('sourceRepo')
12-
const token = core.getInput('github_token', { required: true })
14+
// const token = core.getInput('github_token', { required: true })
1315
// const apicuron_token = core.getInput('apicuron_token', { required: true })
14-
const octokit = github.getOctokit(token)
15-
const sha = github.context.sha
16-
const { owner, repo } = github.context.repo
17-
18-
const data = await octokit.rest.repos.getCommit({
19-
owner,
20-
repo,
21-
ref: sha
22-
})
16+
// const octokit = github.getOctokit(token)
17+
// const sha = github.context.sha
18+
// const { owner, repo } = github.context.repo
19+
// const data = await octokit.rest.repos.getCommit({
20+
// owner,
21+
// repo,
22+
// ref: sha
23+
// })
2324
// add orcid
2425
// send to apicuron
25-
console.log(JSON.stringify(data, null, 2))
26+
// console.log(JSON.stringify(data, null, 2))
2627
// console.log(`Commit Message: ${commit.commit.message}`)
2728
// console.log(`Author Name: ${commit.commit.author?.name}`)
2829
// console.log(`Author Email: ${commit.commit.author?.email}`)

0 commit comments

Comments
 (0)