Skip to content
flag

GitHub Action

Get Primary Language

v1.0 Latest version

Get Primary Language

flag

Get Primary Language

Use the github api to derive the main detected language for the repository

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Get Primary Language

uses: fiddlermikey/[email protected]

Learn more about this action in fiddlermikey/action-get-primary-language

Choose a version

action-get-primary-language

Get Primary Language

Set a personal PAT on the repository or an organization PAT with minimal rights called GH_PAT

Use the ${{ needs.read_type.outputs.primaryLanguage}} in subsequent jobs

name: CI Testing Primary Language
on: [push]

jobs:
  read_type:
    outputs:
      primaryLanguage: ${{ steps.read.outputs.primary_language }}
    runs-on: ubuntu-latest
    name: Detect Primary Language
    steps:
      - name: Read integration_type
        id: read
        uses: fiddlermikey/action-get-primary-language@v1
        with:
          token: ${{ secrets.GH_PAT}}
      - name: Display type
        id: display
        run: |
          echo ${{ steps.read.outputs.primary_language}} | tee -a $GITHUB_STEP_SUMMARY