Skip to content

gouef/githubtoplanguages

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

githubtoplanguages

Generate your Top languages of Github

Static Badge

GoDoc GitHub stars Go Report Card codecov

Versions

Stable Version GitHub Release GitHub Release

Introduction

Generate your Top languages of Github to toplanguages.svg (in root of repository). Next just copy raw link of svg and paste to your Markdown.

Example

Github Top Languages

![Github Top Languages](https://raw.githubusercontent.com/gouef/githubtoplanguages/refs/heads/main/toplanguages.svg)

Action

name: Create Top Languages

on:
  push:
  schedule:
    - cron: '0 */2 * * *'

jobs:
  build-and-run:
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
      - name: Run custom action
        uses: gouef/githubtoplanguages@main
        with:
          botName: "Jan Galek"
          botEmail: "ghome.cz@gmail.com"
          user: "JanGalek"
          limit: 6
          ignoredOrgsFlag: "wowmua"
          ignoredReposFlag: "wowmua/Maps"
          ignoredLangsFlag: ""
          withForks: "false"
        env:
          GITHUB_TOKEN: ${{ secrets.USER_GITHUB_TOKEN }}

Action inputs

Input Default Required Description
botName Jan Galek false Set bot name for contributors
botEmail ghome.cz@gmail.com false Set bot email address for contributors
user `` true Github UserName
limit 6 true Limit of languages
ignoredOrgsFlag `` true Comma-separated list of ignored organizations
ignoredReposFlag `` true Comma-separated list of ignored repositories
ignoredLangsFlag `` false Comma-separated list of ignored languages
withForks false false Include forked repositories in the analysis (true/false)

GitHub Personal Access Token (PAT) Scopes

To successfully analyze repositories, organizations, forks, and Pull Requests, your GitHub Personal Access Token (stored in your repository secrets, e.g., USER_GITHUB_TOKEN) must have specific permissions enabled.

Depending on the type of token you choose to generate, configure the following scopes:

1. Tokens (classic) — Recommended for simplicity

When creating a classic token via Settings -> Developer settings -> Personal access tokens -> Tokens (classic), check the following boxes:

  • repo (Full control of private and public repositories)
    • Why: Crucial for reading your personal code, tracking down fork configurations, and fetching deeply nested Pull Request files.
  • read:org (Under the admin:org section)
    • Why: Absolutely required for the organization module to function. Without this scope, the GitHub GraphQL API will securely hide your organizations and return 0 results.

2. Fine-grained tokens — Recommended for enhanced security

If you prefer restricting the token's lifetime and scoping it down to specific target accounts, go to Tokens (fine-grained) and configure:

Repository permissions

  • Contents: Read-only (To evaluate source files and calculate total code bytes)
  • Metadata: Read-only (Mandatory for fetching repository definitions and standard properties)
  • Pull Requests: Read-only (To inspect line additions and structures inside your PR history)

Organization permissions

  • Members: Read-only (To discover which organization jupiters you are a member of)
  • Metadata: Read-only (To access corporate repositories and public schemas)

Account permissions:

  • Unassigned user data / Profile: Read-only (Required to fetch the user contribution calendar and calculate streaks)

⚠️ Crucial Step for SAML Single Sign-On (SSO)

If any of your organizations (such as private company groups or specific open-source communities like EpicGames) enforce SAML SSO, your token will be blocked by default until you manually authorize it.

  1. Go to your GitHub Personal Access Tokens settings page.
  2. Find your generated token and click the Configure SSO button right next to it.
  3. Locate your organization in the list and click Authorize.

Failure to complete this manual authorization step will cause the API to hide those organizations completely, resulting in empty metrics.

Contributing

Read Contributing

Contributors

JanGalek actions-user

Join our Discord Community! 🎉

Discord

Click above to join our community on Discord!

About

User githubs top languages

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Generated from gouef/github-lib-template