Skip to content

πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰ restore GH actions ongπŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰ #2

πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰ restore GH actions ongπŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰

πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰ restore GH actions ongπŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰ #2

Workflow file for this run

name: 🎨🎯 Emoji Check πŸ’‘πŸ’‘
on: [pull_request, pull_request_target, push, workflow_dispatch]
jobs:
check-emoji:
runs-on: ubuntu-latest
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: npm install emoji-regex
- name: Check PR title for Emojis πŸ”
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target'
uses: actions/github-script@v7
with:
script: |
const emojiRegex = require('emoji-regex');
const regex = emojiRegex();
try {
const title = context.payload.pull_request.title;
if (!regex.test(title)) {
core.setFailed('PR title must include an emoji! Examples: "✨ New feature", "πŸ› Fix bug", "🎨 Update styles"');
} else {
console.log(`βœ… PR title "${title}" contains an emoji - good job! πŸŽ‰`);
}
} catch (error) {
core.setFailed(`Error checking emoji: ${error.message}`);
}