DEV Community

loading...
Cover image for Language Teller

Language Teller

pigeon.js
・1 min read

#actionshackathon

This tag is for submissions and content related to the GitHub Actions x DEV Hackathon.

My Workflow

The GitHub Action 'Language Teller' just do shit as mentioned down :

  • Runs on every push.
  • Detects languages you used in repo.
  • Print them on workflow.
  • That's it.. hehe. Alt text of image

Submission Category:

Yaml File or Link to Code

name: Linguist

on: push

jobs:
  linguist:
    name: Run linguist
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v1
      - uses: fabasoad/linguist-action@v1.0.0
        id: linguist
        with:
          path: './'
          percentage: true
      - name: Print linguist result
        run: echo "${{ steps.linguist.outputs.data }}"

GitHub logo rishivyas1969 / lago-generator

Generates README.md containing logo of used language in this repo.

Additional Resources / Info

Special thanks for making it possible😁

GitHub logo fabasoad / linguist-action

Detects language type for a file, or, given a repository, determine language breakdown in JSON format.

Linguist action

GitHub release (latest SemVer including pre-releases) CI (latest) CI (main) YAML Lint Ruby Lint Dockerfile Lint Shell Lint Known Vulnerabilities

This action uses github/linguist library to detect language type for a file, or, given a repository, determine language breakdown in JSON format.

Inputs

Name Required Description Default Possible values
path No Path to the repository ./ <Path>
percentage No In case of true output will be in percentage format, otherwise - in fractions false <Boolean>

Outputs

Name Required Description
data Yes Result in JSON format

Examples

  1. For folder in case of percentage=true:
{
  "Ruby": "75.21%"
  "Dockerfile": "19.80%"
  "Shell": "5.00%"
}
  1. For folder in case of percentage=false:
{
  "Ruby": 0.7520556609740671
  "Dockerfile": 0.19797596457938013,
  "Shell": 0.04996837444655281
}
  1. For file:
{
  "linguist.rb": {
    "lines": 56
    "sloc": 48,
    "type": 

Here my explanation🧐 stops and laughing ends!🙂

Discussion (0)