A GitHub Action that outputs the repositories languages using List repository languages.
Create a workflow (eg: .github/workflows/seat-count.yml
). See Creating a Workflow file.
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), ', ') }}
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 }}
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'
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 |
Name | Description |
---|---|
languages | The languages of the repository as a JSON array |
To get more help on the Actions see documentation.