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 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 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 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 }}

View file

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