Search for keyphrases in text content or files. Validates if a specific phrase appears a minimum number of times with options for case sensitivity.
steps:
  - name: Check for required phrase in file
    id: keyphrase-check
    uses: skills/action-keyphrase-checker@v1
    with:
      text-file: 'path/to/file.md'
      keyphrase: 'GitHub'
      case-sensitive: false
      minimum-occurrences: 2steps:
  - name: Check direct text content
    id: keyphrase-check
    uses: skills/action-keyphrase-checker@v1
    with:
      text: |
        Some text mentioning GitHub Actions and more GitHub Actions conten
      keyphrase: 'GitHub Actions'
      case-sensitive: true
      minimum-occurrences: 2steps:
  - name: Check keyphrase doesn't appear too often
    id: keyphrase-check
    uses: skills/action-keyphrase-checker@v1
    with:
      text-file: 'docs/content.md'
      keyphrase: 'amazing'
      maximum-occurrences: 3steps:
  - name: Check keyphrase appears in acceptable range
    id: keyphrase-check
    uses: skills/action-keyphrase-checker@v1
    with:
      text-file: 'docs/content.md'
      keyphrase: 'GitHub'
      minimum-occurrences: 2
      maximum-occurrences: 5steps:
  - name: Check for exact number of occurrences
    id: keyphrase-check
    uses: skills/action-keyphrase-checker@v1
    with:
      text-file: 'docs/content.md'
      keyphrase: 'TODO'
      minimum-occurrences: 0
      maximum-occurrences: 0| Input | Description | Required | Default | 
|---|---|---|---|
| text-file | Path to a file containing text to check | No* | - | 
| text | Direct text input to check | No* | - | 
| keyphrase | The phrase to search for in the text | Yes | - | 
| case-sensitive | Whether to perform case-sensitive matching | No | false | 
| minimum-occurrences | Minimum number of occurrences required for success | No | 1 | 
| maximum-occurrences | Maximum number of keyphrase occurrences allowed | No | - | 
*Note: You must provide exactly one of
text-fileortext.
| Output | Description | 
|---|---|
| occurrences | Number of occurrences of the keyphrase found in the text | 
This project is licensed under the MIT License - see the LICENSE file for details.