This commit is contained in:
moss 2025-03-28 21:44:55 +07:00
parent c9845b0256
commit 28df293eef
2 changed files with 40 additions and 41 deletions

View file

@ -67,41 +67,40 @@ jobs:
docker compose pull docker compose pull
docker compose up -d docker compose up -d
echo "${{ steps.gen_ver.outputs.image_ver }}"> success echo "${{ steps.gen_ver.outputs.image_ver }}"> success
- name: Notify Discord Success # - name: Notify Discord Success
if: success() # if: success()
run: | # run: |
curl -H "Content-Type: application/json" \ # curl -H "Content-Type: application/json" \
-X POST \ # -X POST \
-d '{ # -d '{
"embeds": [{ # "embeds": [{
"title": "✅ Deployment Success!", # "title": "✅ Deployment Success!",
"description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Deployed by: `${{github.actor}}`", # "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Deployed by: `${{github.actor}}`",
"color": 3066993, # "color": 3066993,
"footer": { # "footer": {
"text": "Release Notification", # "text": "Release Notification",
"icon_url": "https://example.com/success-icon.png" # "icon_url": "https://example.com/success-icon.png"
}, # },
"timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" # "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"
}] # }]
}' \ # }' \
${{ secrets.DISCORD_WEBHOOK }} # ${{ 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 }}

View file

@ -681,7 +681,7 @@ export class StrategyController extends Controller {
} }
case 2: { case 2: {
const data = await this.strategy2Repo.find({ const data = await this.strategy2Repo.find({
where: { id: requestBody.id ?? "" }, where: { strategyChild1Id: requestBody.id ?? "" },
}); });
if (data == null) { if (data == null) {
throw new HttpError(HttpStatus.NOT_FOUND, "not found strategy2."); throw new HttpError(HttpStatus.NOT_FOUND, "not found strategy2.");
@ -695,7 +695,7 @@ export class StrategyController extends Controller {
} }
case 3: { case 3: {
const data = await this.strategy3Repo.find({ const data = await this.strategy3Repo.find({
where: { id: requestBody.id ?? "" }, where: { strategyChild2Id: requestBody.id ?? "" },
}); });
if (data == null) { if (data == null) {
throw new HttpError(HttpStatus.NOT_FOUND, "not found strategy3."); throw new HttpError(HttpStatus.NOT_FOUND, "not found strategy3.");
@ -709,7 +709,7 @@ export class StrategyController extends Controller {
} }
case 4: { case 4: {
const data = await this.strategy4Repo.find({ const data = await this.strategy4Repo.find({
where: { id: requestBody.id ?? "" }, where: { strategyChild3Id: requestBody.id ?? "" },
}); });
if (data == null) { if (data == null) {
throw new HttpError(HttpStatus.NOT_FOUND, "not found strategy4."); throw new HttpError(HttpStatus.NOT_FOUND, "not found strategy4.");
@ -723,7 +723,7 @@ export class StrategyController extends Controller {
} }
case 5: { case 5: {
const data = await this.strategy5Repo.find({ const data = await this.strategy5Repo.find({
where: { id: requestBody.id ?? "" }, where: { strategyChild4Id: requestBody.id ?? "" },
}); });
if (data == null) { if (data == null) {
throw new HttpError(HttpStatus.NOT_FOUND, "not found strategy5."); throw new HttpError(HttpStatus.NOT_FOUND, "not found strategy5.");