From a29a3386d77b6e1403ba683c8c9021527cb5b87b Mon Sep 17 00:00:00 2001 From: Bright Date: Wed, 26 Mar 2025 18:12:20 +0700 Subject: [PATCH 1/8] no message --- src/controllers/CommandController.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/controllers/CommandController.ts b/src/controllers/CommandController.ts index 35afa13e..0e465565 100644 --- a/src/controllers/CommandController.ts +++ b/src/controllers/CommandController.ts @@ -2617,7 +2617,9 @@ export class CommandController extends Controller { if(_posMasterCommission) { _data.push({ citizenId: _posMasterCommission?.current_holder.citizenId ?? _null, - fullName: `${_posMasterCommission?.current_holder.prefix ?? ""}${_posMasterCommission?.current_holder.firstName ?? ""} ${_posMasterCommission?.current_holder.lastName ?? ""}`, + prefix: _posMasterCommission?.current_holder.prefix, + firstName: _posMasterCommission?.current_holder.firstName, + lastName: _posMasterCommission?.current_holder.lastName, organizationName: _posMasterCommission.orgRoot ? _posMasterCommission.orgRoot.orgRootName : _null, @@ -2642,7 +2644,9 @@ export class CommandController extends Controller { if(_posMasterOfficer) { _data.push({ citizenId: _posMasterOfficer?.current_holder.citizenId ?? _null, - fullName: `${_posMasterOfficer?.current_holder.prefix ?? ""}${_posMasterOfficer?.current_holder.firstName ?? ""} ${_posMasterOfficer?.current_holder.lastName ?? ""}`, + prefix: _posMasterOfficer?.current_holder.prefix, + firstName: _posMasterOfficer?.current_holder.firstName, + lastName: _posMasterOfficer?.current_holder.lastName, organizationName: _posMasterOfficer.orgRoot ? _posMasterOfficer.orgRoot.orgRootName : _null, @@ -2741,7 +2745,9 @@ export class CommandController extends Controller { _posMaster.forEach((x:any) => { _data.push({ citizenId: x?.current_holder.citizenId ?? _null, - fullName: `${x?.current_holder.prefix ?? ""}${x?.current_holder.firstName ?? ""} ${x?.current_holder.lastName ?? ""}`, + prefix: x?.current_holder.prefix, + firstName: x?.current_holder.firstName, + lastName: x?.current_holder.lastName, organizationName: x.orgRoot ? x.orgRoot.orgRootName : _null, positionName: x?.current_holder.position ?? _null, profileId: x?.current_holder.id ?? _null From 6a4f032b0120470fddb673a7063fb01e090422a6 Mon Sep 17 00:00:00 2001 From: mamoss <> Date: Thu, 27 Mar 2025 01:05:38 +0700 Subject: [PATCH 2/8] =?UTF-8?q?=E0=B9=80=E0=B8=A5=E0=B8=82=E0=B8=97?= =?UTF-8?q?=E0=B8=B5=E0=B9=88=E0=B8=95=E0=B8=B3=E0=B9=81=E0=B8=AB=E0=B8=99?= =?UTF-8?q?=E0=B9=88=E0=B8=87=20=E0=B8=A5=E0=B8=B9=E0=B8=81=E0=B8=88?= =?UTF-8?q?=E0=B9=89=E0=B8=B2=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yaml | 72 ++++++++-------- src/controllers/ProfileEmployeeController.ts | 87 +++++++++++++------- 2 files changed, 93 insertions(+), 66 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index c4b02bcc..21dc9ba3 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -67,40 +67,40 @@ jobs: docker compose pull docker compose up -d echo "${{ steps.gen_ver.outputs.image_ver }}"> success - - name: Notify Discord Success - if: success() - run: | - curl -H "Content-Type: application/json" \ - -X POST \ - -d '{ - "embeds": [{ - "title": "✅ Deployment Success!", - "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Deployed by: `${{github.actor}}`", - "color": 3066993, - "footer": { - "text": "Release Notification", - "icon_url": "https://example.com/success-icon.png" - }, - "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" - }] - }' \ - ${{ secrets.DISCORD_WEBHOOK }} + # - name: Notify Discord Success + # if: success() + # run: | + # curl -H "Content-Type: application/json" \ + # -X POST \ + # -d '{ + # "embeds": [{ + # "title": "✅ Deployment Success!", + # "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Deployed by: `${{github.actor}}`", + # "color": 3066993, + # "footer": { + # "text": "Release Notification", + # "icon_url": "https://example.com/success-icon.png" + # }, + # "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" + # }] + # }' \ + # ${{ secrets.DISCORD_WEBHOOK }} - - name: Notify Discord Failure - if: failure() - run: | - curl -H "Content-Type: application/json" \ - -X POST \ - -d '{ - "embeds": [{ - "title": "❌ Deployment Failed!", - "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Attempted by: `${{github.actor}}`", - "color": 15158332, - "footer": { - "text": "Release Notification", - "icon_url": "https://example.com/failure-icon.png" - }, - "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" - }] - }' \ - ${{ secrets.DISCORD_WEBHOOK }} + # - name: Notify Discord Failure + # if: failure() + # run: | + # curl -H "Content-Type: application/json" \ + # -X POST \ + # -d '{ + # "embeds": [{ + # "title": "❌ Deployment Failed!", + # "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Attempted by: `${{github.actor}}`", + # "color": 15158332, + # "footer": { + # "text": "Release Notification", + # "icon_url": "https://example.com/failure-icon.png" + # }, + # "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" + # }] + # }' \ + # ${{ secrets.DISCORD_WEBHOOK }} diff --git a/src/controllers/ProfileEmployeeController.ts b/src/controllers/ProfileEmployeeController.ts index 8f4b4954..14756f42 100644 --- a/src/controllers/ProfileEmployeeController.ts +++ b/src/controllers/ProfileEmployeeController.ts @@ -263,17 +263,18 @@ export class ProfileEmployeeController extends Controller { : null, position: Extension.ToThaiNumber( Extension.ToThaiNumber( - `${item.positionName != null ? item.positionName : "-"} ${item.positionType == null ? (item.positionCee??"") : (item.positionType == "อำนวยการ" || item.positionType == "บริหาร" ? item.positionType : "") + item.positionLevel}`, + `${item.positionName != null ? item.positionName : "-"} ${item.positionType == null ? item.positionCee ?? "" : (item.positionType == "อำนวยการ" || item.positionType == "บริหาร" ? item.positionType : "") + item.positionLevel}`, ), ), posNo: item.posNo != null ? Extension.ToThaiNumber(item.posNo) : "", - orgRoot: item.orgRoot != null ? Extension.ToThaiNumber( item.orgRoot) : "", - orgChild1: item.orgChild1 != null ? Extension.ToThaiNumber( item.orgChild1) : "", - orgChild2: item.orgChild2 != null ? Extension.ToThaiNumber( item.orgChild2) : "", - orgChild3: item.orgChild3 != null ? Extension.ToThaiNumber( item.orgChild3) : "", - orgChild4: item.orgChild4 != null ? Extension.ToThaiNumber( item.orgChild4) : "", - positionCee: item.positionCee != null ? Extension.ToThaiNumber( item.positionCee) : "", - positionExecutive: item.positionExecutive != null ? Extension.ToThaiNumber( item.positionExecutive) : "", + orgRoot: item.orgRoot != null ? Extension.ToThaiNumber(item.orgRoot) : "", + orgChild1: item.orgChild1 != null ? Extension.ToThaiNumber(item.orgChild1) : "", + orgChild2: item.orgChild2 != null ? Extension.ToThaiNumber(item.orgChild2) : "", + orgChild3: item.orgChild3 != null ? Extension.ToThaiNumber(item.orgChild3) : "", + orgChild4: item.orgChild4 != null ? Extension.ToThaiNumber(item.orgChild4) : "", + positionCee: item.positionCee != null ? Extension.ToThaiNumber(item.positionCee) : "", + positionExecutive: + item.positionExecutive != null ? Extension.ToThaiNumber(item.positionExecutive) : "", })) : [ { @@ -350,7 +351,7 @@ export class ProfileEmployeeController extends Controller { salary_raw.length > 0 && salary_raw[0].positionName != null ? Extension.ToThaiNumber( Extension.ToThaiNumber( - `${salary_raw[0].positionName != null ? salary_raw[0].positionName : "-"} ${salary_raw[0].positionType == null ? (salary_raw[0].positionCee??"") : (salary_raw[0].positionType == "อำนวยการ" || salary_raw[0].positionType == "บริหาร" ? salary_raw[0].positionType : "") + salary_raw[0].positionLevel}`, + `${salary_raw[0].positionName != null ? salary_raw[0].positionName : "-"} ${salary_raw[0].positionType == null ? salary_raw[0].positionCee ?? "" : (salary_raw[0].positionType == "อำนวยการ" || salary_raw[0].positionType == "บริหาร" ? salary_raw[0].positionType : "") + salary_raw[0].positionLevel}`, ), ) : "", @@ -2105,20 +2106,20 @@ export class ProfileEmployeeController extends Controller { .andWhere( new Brackets((qb) => { qb.where( - requestBody.keyword != null && requestBody.keyword != "" + requestBody.keyword != null && requestBody.keyword != "" ? `CONCAT(profileEmployee.prefix, profileEmployee.firstName," ",profileEmployee.lastName) LIKE :keyword` : "1=1", { keyword: `%${requestBody.keyword}%`, - }) - .orWhere( - requestBody.keyword != null && requestBody.keyword != "" - ? "profileEmployee.citizenId LIKE :keyword" - : "1=1", - { - keyword: `%${requestBody.keyword}%`, - }, - ); + }, + ).orWhere( + requestBody.keyword != null && requestBody.keyword != "" + ? "profileEmployee.citizenId LIKE :keyword" + : "1=1", + { + keyword: `%${requestBody.keyword}%`, + }, + ); }), ) .andWhere( @@ -2423,7 +2424,7 @@ export class ProfileEmployeeController extends Controller { }, }); - const _profile = { + const _profile: any = { profileId: profile.id, prefix: profile.prefix, rank: profile.rank, @@ -2482,6 +2483,32 @@ export class ProfileEmployeeController extends Controller { ? `${root?.orgRootShortName}${posMaster?.posMasterNo}` : "", }; + if (_profile.child4Id != null) { + _profile.node = 4; + _profile.nodeId = _profile.child4Id; + _profile.nodeDnaId = _profile.child4DnaId; + _profile.nodeShortName = _profile.child4ShortName; + } else if (_profile.child3Id != null) { + _profile.node = 3; + _profile.nodeId = _profile.child3Id; + _profile.nodeDnaId = _profile.child3DnaId; + _profile.nodeShortName = _profile.child3ShortName; + } else if (_profile.child2Id != null) { + _profile.node = 2; + _profile.nodeId = _profile.child2Id; + _profile.nodeDnaId = _profile.child2DnaId; + _profile.nodeShortName = _profile.child2ShortName; + } else if (_profile.child1Id != null) { + _profile.node = 1; + _profile.nodeId = _profile.child1Id; + _profile.nodeDnaId = _profile.child1DnaId; + _profile.nodeShortName = _profile.child1ShortName; + } else if (_profile.rootId != null) { + _profile.node = 0; + _profile.nodeId = _profile.rootId; + _profile.nodeDnaId = _profile.rootDnaId; + _profile.nodeShortName = _profile.rootShortName; + } return new HttpSuccess(_profile); } @@ -4099,7 +4126,7 @@ export class ProfileEmployeeController extends Controller { where: { id: id }, }); if (!profile) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล"); - let _null:any = null; + let _null: any = null; profile.isLeave = requestBody.isLeave; profile.leaveReason = requestBody.leaveReason; profile.dateLeave = requestBody.dateLeave; @@ -4706,14 +4733,14 @@ export class ProfileEmployeeController extends Controller { throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบแบบร่างโครงสร้าง"); } - const permissionProflile = await this.permissionProflileRepository.findOne({ - relations : ["orgRootTree"], - where:{ + const permissionProflile = await this.permissionProflileRepository.findOne({ + relations: ["orgRootTree"], + where: { profileId: id, - orgRootTree:{ - orgRevisionId: orgRevisionPublish.id - } - } + orgRootTree: { + orgRevisionId: orgRevisionPublish.id, + }, + }, }); const posMaster = profile.current_holders == null || @@ -4825,8 +4852,8 @@ export class ProfileEmployeeController extends Controller { ? `${profile.profileEducations[0].degree ?? ""} ${profile.profileEducations[0].field ?? ""}` : "-", statusCheckEdit: profile.statusCheckEdit, - isEdit: permissionProflile?.isEdit??false, - isCheck: permissionProflile?.isCheck??false, + isEdit: permissionProflile?.isEdit ?? false, + isCheck: permissionProflile?.isCheck ?? false, }; if (_profile.child4Id != null) { From 068dabe7927678f05027c351004933ef74e6dcba Mon Sep 17 00:00:00 2001 From: mamoss <> Date: Thu, 27 Mar 2025 03:18:00 +0700 Subject: [PATCH 3/8] =?UTF-8?q?=E0=B8=84=E0=B9=89=E0=B8=99=E0=B8=AB?= =?UTF-8?q?=E0=B8=B2=E0=B8=A5=E0=B8=B3=E0=B8=94=E0=B8=B1=E0=B8=9A=E0=B9=82?= =?UTF-8?q?=E0=B8=84=E0=B8=A3=E0=B8=87=E0=B8=AA=E0=B8=A3=E0=B9=89=E0=B8=B2?= =?UTF-8?q?=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/OrganizationController.ts | 47 ++++++++++++++++++++--- 1 file changed, 42 insertions(+), 5 deletions(-) diff --git a/src/controllers/OrganizationController.ts b/src/controllers/OrganizationController.ts index f77b48a0..b7be0f34 100644 --- a/src/controllers/OrganizationController.ts +++ b/src/controllers/OrganizationController.ts @@ -36,6 +36,8 @@ import { EmployeePosition } from "../entities/EmployeePosition"; import { EmployeePosMaster } from "../entities/EmployeePosMaster"; import { EmployeeTempPosMaster } from "../entities/EmployeeTempPosMaster"; import { AuthRole } from "../entities/AuthRole"; +import { PosType } from "../entities/PosType"; +import { PosLevel } from "../entities/PosLevel"; @Route("api/v1/org") @Tags("Organization") @@ -60,6 +62,8 @@ export class OrganizationController extends Controller { private employeePosMasterRepository = AppDataSource.getRepository(EmployeePosMaster); private employeePositionRepository = AppDataSource.getRepository(EmployeePosition); private employeeTempPosMasterRepository = AppDataSource.getRepository(EmployeeTempPosMaster); + private posTypeRepository = AppDataSource.getRepository(PosType); + private posLevelRepository = AppDataSource.getRepository(PosLevel); /** * API ล้างข้อมูล @@ -152,14 +156,17 @@ export class OrganizationController extends Controller { data: { requestBody: requestBody, request: request.user, - revision: revision + revision: revision, }, - } + }; try { await sendToQueueOrgDraft(msg); - return new HttpSuccess ('Draft is being created... Processing in the background.'); - } catch (error:any) { - return new HttpError (HttpStatusCode.NOT_FOUND,'Failed to process the draft. Please try again later.'); + return new HttpSuccess("Draft is being created... Processing in the background."); + } catch (error: any) { + return new HttpError( + HttpStatusCode.NOT_FOUND, + "Failed to process the draft. Please try again later.", + ); } } @@ -7544,4 +7551,34 @@ export class OrganizationController extends Controller { }); } } + + /** + * API ลำดับโครงสร้าง + * + * @summary - ลำดับโครงสร้าง (ADMIN) + * + */ + @Get("root/search/sort") + async searchSortRootLevelType(@Request() request: RequestWithUser) { + const root = await this.orgRootRepository.find({ + where: { + orgRevision: { orgRevisionIsDraft: false, orgRevisionIsCurrent: true }, + }, + order: { orgRootOrder: "ASC" }, + select: ["orgRootName"], + }); + const posType = await this.posTypeRepository.find({ + order: { posTypeRank: "ASC" }, + select: ["posTypeName"], + }); + const posLevel = await this.posLevelRepository.find({ + order: { posLevelRank: "ASC" }, + select: ["posLevelName"], + }); + return new HttpSuccess({ + root: root, + posTypeNameOrder: posType, + posLevelNameOrder: posLevel, + }); + } } From a78c81ca906118abef16ce6af504115ba1cc3767 Mon Sep 17 00:00:00 2001 From: mamoss <> Date: Thu, 27 Mar 2025 03:20:30 +0700 Subject: [PATCH 4/8] =?UTF-8?q?sort=20=E0=B8=9B=E0=B8=A5=E0=B8=B1=E0=B8=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/OrganizationController.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/OrganizationController.ts b/src/controllers/OrganizationController.ts index b7be0f34..99fef001 100644 --- a/src/controllers/OrganizationController.ts +++ b/src/controllers/OrganizationController.ts @@ -7564,7 +7564,7 @@ export class OrganizationController extends Controller { where: { orgRevision: { orgRevisionIsDraft: false, orgRevisionIsCurrent: true }, }, - order: { orgRootOrder: "ASC" }, + order: { isDeputy: "DESC", orgRootOrder: "ASC" }, select: ["orgRootName"], }); const posType = await this.posTypeRepository.find({ From 8fc10639f5578489921d36f7294d5ab004f136ef Mon Sep 17 00:00:00 2001 From: mamoss <> Date: Thu, 27 Mar 2025 03:24:53 +0700 Subject: [PATCH 5/8] =?UTF-8?q?sort=20=E0=B8=9B=E0=B8=A5=E0=B8=B1=E0=B8=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/OrganizationController.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/OrganizationController.ts b/src/controllers/OrganizationController.ts index 99fef001..bb806244 100644 --- a/src/controllers/OrganizationController.ts +++ b/src/controllers/OrganizationController.ts @@ -7564,7 +7564,7 @@ export class OrganizationController extends Controller { where: { orgRevision: { orgRevisionIsDraft: false, orgRevisionIsCurrent: true }, }, - order: { isDeputy: "DESC", orgRootOrder: "ASC" }, + order: { isDeputy: "ASC", orgRootOrder: "ASC" }, select: ["orgRootName"], }); const posType = await this.posTypeRepository.find({ From 48737c094e50fd49d792c655846498dab8dc7551 Mon Sep 17 00:00:00 2001 From: mamoss <> Date: Thu, 27 Mar 2025 03:41:24 +0700 Subject: [PATCH 6/8] map sort org --- src/controllers/OrganizationController.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/controllers/OrganizationController.ts b/src/controllers/OrganizationController.ts index bb806244..d74f5939 100644 --- a/src/controllers/OrganizationController.ts +++ b/src/controllers/OrganizationController.ts @@ -7564,7 +7564,7 @@ export class OrganizationController extends Controller { where: { orgRevision: { orgRevisionIsDraft: false, orgRevisionIsCurrent: true }, }, - order: { isDeputy: "ASC", orgRootOrder: "ASC" }, + order: { isDeputy: "DESC", orgRootOrder: "ASC" }, select: ["orgRootName"], }); const posType = await this.posTypeRepository.find({ @@ -7576,9 +7576,9 @@ export class OrganizationController extends Controller { select: ["posLevelName"], }); return new HttpSuccess({ - root: root, - posTypeNameOrder: posType, - posLevelNameOrder: posLevel, + root: root.map((x) => x.orgRootName), + posTypeNameOrder: posType.map((x) => x.posTypeName), + posLevelNameOrder: posLevel.map((x) => x.posLevelName), }); } } From 274cdc27d78db4efe7fda0cb3af44a66d76b96e1 Mon Sep 17 00:00:00 2001 From: mamoss <> Date: Thu, 27 Mar 2025 05:24:33 +0700 Subject: [PATCH 7/8] sort desc --- src/controllers/OrganizationController.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controllers/OrganizationController.ts b/src/controllers/OrganizationController.ts index d74f5939..c44120df 100644 --- a/src/controllers/OrganizationController.ts +++ b/src/controllers/OrganizationController.ts @@ -7568,11 +7568,11 @@ export class OrganizationController extends Controller { select: ["orgRootName"], }); const posType = await this.posTypeRepository.find({ - order: { posTypeRank: "ASC" }, + order: { posTypeRank: "DESC" }, select: ["posTypeName"], }); const posLevel = await this.posLevelRepository.find({ - order: { posLevelRank: "ASC" }, + order: { posLevelRank: "DESC" }, select: ["posLevelName"], }); return new HttpSuccess({ From fdf76131f8f95dfc0828647ec2b8a2dad030fd51 Mon Sep 17 00:00:00 2001 From: mamoss <> Date: Thu, 27 Mar 2025 10:32:48 +0700 Subject: [PATCH 8/8] on noti --- .github/workflows/release.yaml | 72 +++++++++++++++++----------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 21dc9ba3..c4b02bcc 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -67,40 +67,40 @@ jobs: docker compose pull docker compose up -d echo "${{ steps.gen_ver.outputs.image_ver }}"> success - # - name: Notify Discord Success - # if: success() - # run: | - # curl -H "Content-Type: application/json" \ - # -X POST \ - # -d '{ - # "embeds": [{ - # "title": "✅ Deployment Success!", - # "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Deployed by: `${{github.actor}}`", - # "color": 3066993, - # "footer": { - # "text": "Release Notification", - # "icon_url": "https://example.com/success-icon.png" - # }, - # "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" - # }] - # }' \ - # ${{ secrets.DISCORD_WEBHOOK }} + - name: Notify Discord Success + if: success() + run: | + curl -H "Content-Type: application/json" \ + -X POST \ + -d '{ + "embeds": [{ + "title": "✅ Deployment Success!", + "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Deployed by: `${{github.actor}}`", + "color": 3066993, + "footer": { + "text": "Release Notification", + "icon_url": "https://example.com/success-icon.png" + }, + "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" + }] + }' \ + ${{ secrets.DISCORD_WEBHOOK }} - # - name: Notify Discord Failure - # if: failure() - # run: | - # curl -H "Content-Type: application/json" \ - # -X POST \ - # -d '{ - # "embeds": [{ - # "title": "❌ Deployment Failed!", - # "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Attempted by: `${{github.actor}}`", - # "color": 15158332, - # "footer": { - # "text": "Release Notification", - # "icon_url": "https://example.com/failure-icon.png" - # }, - # "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" - # }] - # }' \ - # ${{ secrets.DISCORD_WEBHOOK }} + - name: Notify Discord Failure + if: failure() + run: | + curl -H "Content-Type: application/json" \ + -X POST \ + -d '{ + "embeds": [{ + "title": "❌ Deployment Failed!", + "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Attempted by: `${{github.actor}}`", + "color": 15158332, + "footer": { + "text": "Release Notification", + "icon_url": "https://example.com/failure-icon.png" + }, + "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" + }] + }' \ + ${{ secrets.DISCORD_WEBHOOK }}