Skip to content

멘토 체크 API 호출 최적화 및 멘토 페이지 이동 버그 수정 #24

멘토 체크 API 호출 최적화 및 멘토 페이지 이동 버그 수정

멘토 체크 API 호출 최적화 및 멘토 페이지 이동 버그 수정 #24

Workflow file for this run

name: Auto Label PR
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
label:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Detect changed apps
id: detect
run: |
# Get changed files between base and head
BASE_SHA="${{ github.event.pull_request.base.sha }}"
HEAD_SHA="${{ github.event.pull_request.head.sha }}"
FILES=$(git diff --name-only $BASE_SHA $HEAD_SHA)
echo "Changed files:"
echo "$FILES"
# Check for web changes
if echo "$FILES" | grep -q "^apps/web/"; then
echo "web=true" >> $GITHUB_OUTPUT
echo "✓ Detected changes in apps/web"
else
echo "web=false" >> $GITHUB_OUTPUT
fi
# Check for admin changes
if echo "$FILES" | grep -q "^apps/admin/"; then
echo "admin=true" >> $GITHUB_OUTPUT
echo "✓ Detected changes in apps/admin"
else
echo "admin=false" >> $GITHUB_OUTPUT
fi
- name: Add labels
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const labels = [];
if ('${{ steps.detect.outputs.web }}' === 'true') {
labels.push('web');
}
if ('${{ steps.detect.outputs.admin }}' === 'true') {
labels.push('admin');
}
if (labels.length > 0) {
console.log(`Adding labels: ${labels.join(', ')}`);
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: labels
});
} else {
console.log('No app-specific changes detected');
}