Added args to script

This commit is contained in:
Sebastian Seedorf
2022-01-25 22:10:11 +01:00
parent e48991935c
commit a29dfb59aa
4 changed files with 50 additions and 4 deletions

View File

@@ -16,8 +16,8 @@ const timeouts: Record<string, NodeJS.Timeout> = {}
async function parsePushHook(webhook: PushWebhook) {
const repository: string|undefined = webhook.event_data?.repository?.repo_full_name
const tag = webhook.event_data?.resources?.[0]?.tag
if (!repository || !tag) {
const {tag, resource_url} = webhook.event_data?.resources?.[0] ?? { }
if (!repository || !tag || !resource_url) {
return
}
clearTimeout(timeouts[repository])
@@ -27,7 +27,7 @@ async function parsePushHook(webhook: PushWebhook) {
.replace(/[^\w\s/]/gi, '-')
.replace(/\//gi, '_')
try {
const cp = spawn(`./${filename}.sh`, [], {
const cp = spawn(`./${filename}.sh`, [tag, resource_url], {
cwd: rootDir,
stdio: ['inherit', 'inherit', 'inherit', 'ipc']
});