Skip to content

rewindio/list-repository-languages

 
 

Repository files navigation

Action

A GitHub Action that outputs the repositories languages using List repository languages.

Usage

Create a workflow (eg: .github/workflows/seat-count.yml). See Creating a Workflow file.

Example Basic

Print all the languages as a comma separated list.

name: Print Languages
on:
  workflow_dispatch:

jobs:
  run:
    runs-on: ubuntu-latest
    steps:
      - uses: austenstone/list-repository-languages@main
        id: list-languages
      - run: echo ${{ join(fromJSON(steps.list-languages.outputs.languages), ', ') }}

Example Matrix

Run a a matrix of jobs for each language.

name: Matrix Language Jobs
on:
  workflow_dispatch:

jobs:
  run:
    runs-on: ubuntu-latest
    steps:
      - uses: austenstone/list-repository-languages@main
        id: list-languages
    outputs:
      languages: ${{ steps.list-languages.outputs.languages }}

  print:
    needs: [run]
    runs-on: ubuntu-latest
    strategy:
      matrix:
        language: ${{ fromJSON(needs.run.outputs.languages) }}
    steps:
      - run: echo ${{ matrix.language }}

CodeQL

You can use the input codeql to map languages to codeql supported languages. example.

      - uses: austenstone/list-repository-languages@main
        id: list-languages
        with:
          codeql: 'true'

➡️ Inputs

Various inputs are defined in action.yml:

Name Description Default
github‑token Token to use to authorize. ${{ github.token }}
owner The repository owner ${{ github.repository_owner }}
repo The repository name ${{ github.event.repository.name }}
codeql Map to langauges supported by codeql false

⬅️ Outputs

Name Description
languages The languages of the repository as a JSON array

Further help

To get more help on the Actions see documentation.

About

Lists languages for the specified repository.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 100.0%