From 6837e3de051a612f627500cc999604d900d68f31 Mon Sep 17 00:00:00 2001 From: Eric Vantillard Date: Mon, 3 Apr 2023 18:46:01 +0200 Subject: [PATCH] chore(configure-workflow): prepare first version for testing in prod --- .../actions/configure-workflow/dist/index.js | Bin 594291 -> 595029 bytes .../configure-workflow/dist/index.js.map | Bin 398942 -> 399830 bytes .../configure-workflow/package-lock.json | 18 ++----- .../actions/configure-workflow/package.json | 5 +- .../actions/configure-workflow/src/main.ts | 50 +++++++++++++----- 5 files changed, 44 insertions(+), 29 deletions(-) diff --git a/.github/actions/configure-workflow/dist/index.js b/.github/actions/configure-workflow/dist/index.js index 0dd644c5661764100f25649633808e69cab64754..0880823e8d457031f4e251fa8de9ad997295bf91 100644 GIT binary patch delta 786 zcma)4%}&BV5Dp3gg_B3aVbc(SXyD{eKrSZU4T(1+F6|Z?HoMquZHys3c<=%G2A({c zc<@Pl3va%Fv%4)R4JK^z?O}JmnQy+C-?!%Xd-LPmh&a0rC>@c9fC&HUkubl#z)zH8 zyMvw$1V@CfZ_QBp+{Kpfa+dze2n!2>Oo}Ij65H%6mVB4T;!JQ#x|C1b<^oC~PuD^! zejl0W2qhJ}>M6dh9Ym6969)&>-!`AtwU#fDI#7z1>Q42z%;D|Unjj*(@3)RYPFXuJ zh{M`Rq#MwLkb857@(|gsSYYW(hLwVz$xOyb|$GuKP@~5jYHHZ;_9) zY^?5TgT5JN_UDCBEyO>@|zgZ4FQ+9>H@xHMK)(zdYT0Cb|4u^$Dt4m2_p|yIP|tdwUtyUx)PqUy`5M-%r=>p+d-=8i delta 217 zcmcb*Lgn)!l?@hLEE$O@d7Eo_I2k8*^BOYNPR`^utuIQ|%gjs5*GLG-NL47$FUn5K z$uC#PEVfcmsV+#Y%*jto(Sr%sCTLo7)pDhk<|UV8=I1Ho=LM7&XJ|l`X)086DF8uo zK8l$csfj5-vE1Cu5;S8$GD7hXDX7sP7dFfDx6AW00x=U1GXpUT5VHa?8xXStF~@d! Ieoix10BJBqtN;K2 diff --git a/.github/actions/configure-workflow/dist/index.js.map b/.github/actions/configure-workflow/dist/index.js.map index ad4dd681ccbe39ddfe31625b6b1e055ad6d0350c..57c2b66014041d0fd2e6c7d05fd81a405b0cc985 100644 GIT binary patch delta 762 zcma)4Jxc>Y5XG1SKPn|^ia_Rqk~@?HJ56F?5gQRhN;!<1++Gs0?4Gw5gNP_tNa`!n zi9f(XNRh(EUtuW-{t$QXa*>M`8JJ>c-^`mgGoLTXk74qarS}=FbP1{A%P!__`3h54 zv(YtS$kgG+pdgI*+HRu-VLXQ#Zkti>E1ftdsE!FXjZ7hcO1QKJqnr_(Bdn=lE4q9uda;C)ru*lJUYY1v2ZD)%CmoM;7W2srlb*y=c%|gIZncj}sWJicunt zXQ?;=Z~Ewnl4#i$qUMmN6LX#p$HtUkp;tDg@SCoOri4FPkEE$O@d7IBFiZD*LS5cn4T1kMhcJev}3zwo)z0AC{e2s*Vj8uj4 z{G#l%ocwZy%wj7AmFj}T%AEYf6g`-5ZGxtCOkQnFURr5ha!F=>o { } } -function hadnleEvent(): void { +function onPullRequestEvent(payload: PullRequestEvent) { + switch(payload.action){ + case "labeled": + console.log("pull request label "+payload.label) + break; + default: + console.log("pull request action "+payload.action) + } + console.info('pull request event:',payload) +} + +function onWorkflowDispatchEvent(payload: WorkflowDispatchEvent): void { + console.info('workflow dispatch event:',payload) +} + +function onPushEvent(payload: PushEvent): void { + console.info('push event:',payload) +} + +function onReleaseEvent(payload: ReleaseEvent) { + console.info('onReleaseEvent:',payload) + +} + +function handleEvent(): void { console.info(`eventName: ${github.context.eventName}`); switch (github.context.eventName) { case "workflow_dispatch": onWorkflowDispatchEvent(github.context.payload as WorkflowDispatchEvent); break; case "push": - onPush(github.context.payload as PushEvent); + onPushEvent(github.context.payload as PushEvent); + break; + case "pull_request": + onPullRequestEvent(github.context.payload as PullRequestEvent) + break; + // case "pull_request_target": + // onPullRequestEvent(github.context.payload as PullRequestEvent) + // break; + case "release": + onReleaseEvent(github.context.payload as ReleaseEvent) + default: break; } } -function onWorkflowDispatchEvent(payload: WorkflowDispatchEvent): void { - core.info(`The workflow is: ${payload.workflow}`); -} - -function onPush(payload: PushEvent): void { - core.info(`The head commit is: ${payload.head_commit}`); -} - -hadnleEvent(); +handleEvent(); run(); \ No newline at end of file