pocket-cli 1.0.2

A CLI tool for saving, organizing, and retrieving code snippets with integrated version control
Documentation
name: "Add Flares to Issues and PRs"

on:
  issues:
    types: [labeled]
  pull_request:
    types: [labeled]

jobs:
  add-flares:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/github-script@v6
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          script: |
            const { owner, repo } = context.repo;
            const issue_number = context.issue.number;
            const label = context.payload.label.name;
            
            // Get current title
            const { data: issue } = await github.rest.issues.get({
              owner,
              repo,
              issue_number
            });
            
            let title = issue.title;
            
            // Remove any existing emojis at the beginning
            title = title.replace(/^(\s*)(๐Ÿ›|โœจ|๐Ÿ“|โ“|โšก๏ธ|๐Ÿงฐ|๐Ÿ”|๐ŸŽจ|โšก|๐Ÿ“ฆ|๐Ÿ”–|๐Ÿ†˜|๐Ÿš€|๐Ÿงช|๐Ÿ”ง|๐Ÿ”’)\s+/, '$1');
            
            // Add new emoji based on label
            const flares = {
              'bug': '๐Ÿ›',
              'enhancement': 'โœจ',
              'documentation': '๐Ÿ“',
              'question': 'โ“',
              'performance': 'โšก๏ธ',
              'backpack': '๐Ÿงฐ',
              'search': '๐Ÿ”',
              'ui': '๐ŸŽจ',
              'workflow': '๐Ÿš€',
              'dependencies': '๐Ÿ“ฆ',
              'versioning': '๐Ÿ”–',
              'help wanted': '๐Ÿ†˜',
              'good first issue': '๐Ÿงช',
              'refactor': '๐Ÿ”ง',
              'security': '๐Ÿ”’'
            };
            
            const flare = flares[label];
            if (flare) {
              const newTitle = `${flare} ${title}`;
              
              await github.rest.issues.update({
                owner,
                repo,
                issue_number,
                title: newTitle
              });
              
              console.log(`Added flare ${flare} to issue/PR #${issue_number}`);
            }