-
Notifications
You must be signed in to change notification settings - Fork 1
[PROD HOTFIX] - Updating payments via wallet #108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…at-on-updating-legacy PS-429 dateformat on updating legacy
| jobs: | ||
| trivy-scan: | ||
| name: Use Trivy | ||
| runs-on: ubuntu-24.04 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[❗❗ correctness]
Ensure that ubuntu-24.04 is a valid and supported runner version. GitHub Actions currently supports ubuntu-latest, ubuntu-22.04, and ubuntu-20.04. Using an unsupported version may cause the workflow to fail.
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Run Trivy scanner in repo mode | ||
| uses: aquasecurity/[email protected] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[maintainability]
Consider updating to the latest version of aquasecurity/trivy-action to benefit from the latest features and security patches. Verify compatibility with your workflow before updating.
| output: 'trivy-results.sarif' | ||
| severity: 'CRITICAL,HIGH,UNKNOWN' | ||
| scanners: vuln,secret,misconfig,license | ||
| github-pat: ${{ secrets.GITHUB_TOKEN }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[❗❗ security]
Ensure that the GITHUB_TOKEN has the necessary permissions to perform the scan and upload results. Review the token's permissions to avoid potential security issues.
| } from 'src/shared/topcoder/challenges.service'; | ||
| import { Logger } from 'src/shared/global'; | ||
|
|
||
| function formatDate(date = new Date()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[maintainability]
The formatDate function is defined but not used within this diff. Ensure that this function is necessary for the current scope or remove it to maintain clean code.
| return ( | ||
| `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())} ` + | ||
| `${pad(date.getHours())}:${pad(date.getMinutes())}:${pad(date.getSeconds())}.` + | ||
| `${pad(date.getMilliseconds(), 3)}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[maintainability]
Consider using a more standard date formatting library, such as date-fns or moment, to handle date formatting. This can improve maintainability and reduce potential errors in date manipulation.
| status: body.paymentStatus, | ||
| amount: body.paymentAmount, | ||
| releaseDate: body.releaseDate, | ||
| releaseDate: formatDate(new Date(body.releaseDate)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[correctness]
The formatDate function is used to format the releaseDate. Ensure that formatDate handles all possible date formats that body.releaseDate might contain, and consider adding error handling for cases where the date format is invalid or conversion fails.
https://topcoder.atlassian.net/browse/PS-429