πππππ restore GH actions ongπππππ #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}`); | |
} |