vocabulary-action

command module
v0.0.0-...-a058bfc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 15, 2023 License: MIT Imports: 2 Imported by: 0

README

vocabulary action

A Github Action to create and update lists of vocabulary.

Usage

Note The Action has to be used in a Job that runs on a UNIX system (e.g. ubuntu-latest).

Example workflow:

name: Add Vocabulary

on:
  workflow_dispatch:
    inputs:
      language:
        description: Language of the vocabulary list
        required: true
        type: string
      vocabulary:
        description: Vocabulary list, one word per line
        required: true
        type: string

jobs:
  test:
    runs-on: ubuntu-latest

    # permission required for committing to the repository
    permissions:
      contents: write

    steps:
      - name: Checkout repository
        uses: actions/checkout@v3
        with:
          ref: ${{ github.head_ref }}

      - name: Add vocabulary
        id: vocabulary
        uses: leonhfr/vocabulary-action@release
        with:
          language: ${{ inputs.language }}
          vocabulary: ${{ inputs.vocabulary }}

      - name: Commit
        uses: stefanzweifel/git-auto-commit-action@v4
        with:
          file_pattern: ${{ steps.vocabulary.outputs.directory }}
          commit_message: "Add vocabulary: ${{ steps.vocabulary.outputs.summary }}"

Config

The action looks for a config file named vocabulary.yml in the root of the repository:

languages:
  ca: catalan/vocabulary
  de: german/vocabulary
  en: english/vocabulary
  es: spanish/vocabulary
  default: todo/vocabulary # not required

Inputs

The action requires two inputs:

  • language: The language of the vocabulary list. Will be used to lookup the target directory in the config file.
  • vocabulary: Vocabulary list, one word per file.

Outputs

You can use the outputs in other actions:

  • directory: The repository directory modified by the action.
  • summary: Summary of added vocabulary, intended to be used in a commit message.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL