Skip to content

Commit 67a587f

Browse files
authored
Merge pull request #108 from topcoder-platform/dev
[PROD HOTFIX] - Updating payments via wallet
2 parents 5ea21be + 177965e commit 67a587f

File tree

2 files changed

+45
-1
lines changed

2 files changed

+45
-1
lines changed

.github/workflows/trivy.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Trivy Scanner
2+
3+
permissions:
4+
contents: read
5+
security-events: write
6+
on:
7+
push:
8+
branches:
9+
- main
10+
- dev
11+
pull_request:
12+
jobs:
13+
trivy-scan:
14+
name: Use Trivy
15+
runs-on: ubuntu-24.04
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Run Trivy scanner in repo mode
21+
uses: aquasecurity/trivy-action@0.33.1
22+
with:
23+
scan-type: "fs"
24+
ignore-unfixed: true
25+
format: "sarif"
26+
output: "trivy-results.sarif"
27+
severity: "CRITICAL,HIGH,UNKNOWN"
28+
scanners: vuln,secret,misconfig,license
29+
github-pat: ${{ secrets.GITHUB_TOKEN }}
30+
31+
- name: Upload Trivy scan results to GitHub Security tab
32+
uses: github/codeql-action/upload-sarif@v3
33+
with:
34+
sarif_file: "trivy-results.sarif"

src/api/admin/admin.service.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@ import {
1919
} from 'src/shared/topcoder/challenges.service';
2020
import { Logger } from 'src/shared/global';
2121

22+
function formatDate(date = new Date()) {
23+
const pad = (n, z = 2) => String(n).padStart(z, '0');
24+
25+
return (
26+
`${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())} ` +
27+
`${pad(date.getHours())}:${pad(date.getMinutes())}:${pad(date.getSeconds())}.` +
28+
`${pad(date.getMilliseconds(), 3)}`
29+
);
30+
}
31+
2232
/**
2333
* The admin winning service.
2434
*/
@@ -322,7 +332,7 @@ export class AdminService {
322332
userId: +winning.winner_id,
323333
status: body.paymentStatus,
324334
amount: body.paymentAmount,
325-
releaseDate: body.releaseDate,
335+
releaseDate: formatDate(new Date(body.releaseDate)),
326336
};
327337

328338
await this.tcChallengesService.updateLegacyPayments(

0 commit comments

Comments
 (0)