Skip to content

FAC-121 feat: add ProgramFilterOptionResponseDto with moodleCategoryId #375

FAC-121 feat: add ProgramFilterOptionResponseDto with moodleCategoryId

FAC-121 feat: add ProgramFilterOptionResponseDto with moodleCategoryId #375

Workflow file for this run

name: PR Lint
on:
push:
branches:
- main
- staging
- develop
pull_request:
branches:
- main
- staging
- "**"
jobs:
lint:
name: Lint Code
runs-on: ubuntu-latest
steps:
# Checkout
- name: Checkout code
uses: actions/checkout@v4
# Setup Node.js with npm cache
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 24
cache: "npm"
# Install dependencies
- name: Install dependencies
run: npm ci
# Run lint
- name: Run lint
id: run-lint
run: |
npm run lint || true
# Always continue even if lint fails, so we can still send the report
- name: Check lint status
id: lint-status
run: |
if npm run lint; then
echo "LINT_STATUS=✅ Lint passed, clean code! ✨" >> $GITHUB_ENV
echo "EMBED_COLOR=3066993" >> $GITHUB_ENV
else
echo "LINT_STATUS=❌ Lint failed, fix your code! 🧹" >> $GITHUB_ENV
echo "EMBED_COLOR=15158332" >> $GITHUB_ENV
fi
- name: Discord notification
if: ${{ github.event_name == 'pull_request' }}
continue-on-error: true
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_PR_WEBHOOK }}
DISCORD_USERNAME: "Leo Bermudez"
DISCORD_AVATAR: "https://scontent.fceb3-1.fna.fbcdn.net/v/t39.30808-6/468222997_122103231422632296_9144898883232265379_n.jpg?_nc_cat=106&ccb=1-7&_nc_sid=a5f93a&_nc_eui2=AeHoNtBKxsVZXTupsNj-esNhRNVDDdYZjQBE1UMN1hmNAGnoZ2ya3PR09OY6n2E2b1Z5gIekCRzbHws1UeaCGBwB&_nc_ohc=9Qh9lj71VS8Q7kNvwGrE1Rp&_nc_oc=AdlJpFX5AmwR43Q-eeyLtsxGFhnT98NV2BXBwTMhBSAANlchvtOKTlfjy__8J69YvPo&_nc_zt=23&_nc_ht=scontent.fceb3-1.fna&_nc_gid=wKqKrjoD3a6tAx7ylO3cOw&oh=00_AftMnDuaL-np4DOMaOTcZZNSOEpt0SPrCOpd40fCR57xSw&oe=69994063"
DISCORD_EMBEDS: >
[
{
"author": {
"name": "${{ github.event.pull_request.user.login }}",
"icon_url": "${{ github.event.pull_request.user.avatar_url }}"
},
"title": "${{ github.event.pull_request.title }}",
"url": "${{ github.event.pull_request.html_url }}",
"description": "${{ env.LINT_STATUS }}",
"color": ${{ env.EMBED_COLOR }},
"fields": [
{
"name": "Commit",
"value": "${{ github.sha }}"
}
],
"timestamp": "${{ github.event.pull_request.updated_at }}"
}
]
DISCORD_MESSAGE: ${{ env.LINT_STATUS == '✅ Lint passed, clean code! ✨' && '✅ Lint passed! pwede na mag NU' || 'Naa kay sayup, wala kay respeto! 😡' }}
run: |
payload=$(jq -nc \
--arg username "$DISCORD_USERNAME" \
--arg avatar_url "$DISCORD_AVATAR" \
--arg content "$DISCORD_MESSAGE" \
--argjson embeds "$DISCORD_EMBEDS" \
'{username: $username, avatar_url: $avatar_url, content: $content, embeds: $embeds}')
if [ -z "$DISCORD_WEBHOOK" ]; then
echo "DISCORD_PR_WEBHOOK is not configured; skipping Discord notification."
exit 0
fi
curl \
--fail \
--show-error \
--silent \
-H "Content-Type: application/json" \
-d "$payload" \
"$DISCORD_WEBHOOK"