Skip to content

feat: thumbnail image에 border 추가 #379

feat: thumbnail image에 border 추가

feat: thumbnail image에 border 추가 #379

Workflow file for this run

name: PR Title Labeler
on:
pull_request:
types:
- opened
- edited
- reopened
jobs:
label-pr:
runs-on: ubuntu-latest
steps:
- name: Label PR based on title
uses: actions/github-script@v7
with:
github-token: ${{ secrets.PAT_TOKEN }}
script: |
const title = context.payload.pull_request.title || "";
console.log(`📋 PR Title: ${title}`);
const labelMap = [
{ pattern: /^feat:/i, label: '✨ feat' },
{ pattern: /^fix:/i, label: '🐞 fix' },
{ pattern: /^refactor:/i, label: '🔨 refactor' },
{ pattern: /^docs:/i, label: '📃 docs' },
{ pattern: /^chore:/i, label: '⚙️ chore' },
{ pattern: /^test:/i, label: '✅ test' },
{ pattern: /^style:/i, label: '🎨 style' },
{ pattern: /^qa:/i, label: '🛠️ qa' }
];
// 매칭되는 라벨 찾기
const labelsToAdd = labelMap
.filter(entry => entry.pattern.test(title))
.map(entry => entry.label);
if (labelsToAdd.length > 0) {
console.log(`✅ Adding labels: ${labelsToAdd.join(', ')}`);
try {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: labelsToAdd
});
console.log(`✅ Successfully added labels: ${labelsToAdd.join(', ')}`);
} catch (error) {
console.error(`❌ Failed to add labels: ${error.message}`);
core.setFailed(`Failed to add labels: ${error.message}`);
}
} else {
console.log('⚠️ No matching labels found for PR title.');
console.log('💡 Tip: Use prefixes like "feat:", "fix:", "qa:", etc.');
}