Skip to content

Commit 7c8a022

Browse files
committed
Remove check for event types
We are just serializing the event into sqlite. There's no need to have an allowlist.
1 parent 8fb551b commit 7c8a022

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

src/main.ts

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,6 @@ import { open } from 'sqlite'
66
import { nanoid } from 'nanoid'
77

88
const dbfile = 'github-archive.sqlite'
9-
const events = [
10-
'issues',
11-
'issue_comment',
12-
'pull_request',
13-
'pull_request_review',
14-
'pull_request_review_comment',
15-
]
169
async function run(): Promise<void> {
1710
const now = new Date().toISOString()
1811
const id = nanoid()
@@ -33,10 +26,6 @@ async function run(): Promise<void> {
3326
core.endGroup()
3427

3528
const eventName = github.context.eventName
36-
if (!events.includes(eventName)) {
37-
throw new Error(`Unsupported event type: ${eventName}`)
38-
}
39-
4029
// Actions can be triggered in parallel
4130
// As a result, several invocations of this code might be
4231
// executing right now.
@@ -71,11 +60,7 @@ async function run(): Promise<void> {
7160
)
7261
await db.close()
7362
await exec('git', ['add', dbfile])
74-
await exec('git', [
75-
'commit',
76-
'-m',
77-
`Capturing event ${eventName} (id: ${id})`,
78-
])
63+
await exec('git', ['commit', '-m', `${eventName} ${id}`])
7964
try {
8065
await exec('git', ['push'])
8166
// if the push succeeded, we're finished

0 commit comments

Comments
 (0)