github-languages 0.4.0

All GitHub's supported languages
Documentation
name: Update GitHub Languages

on:
  workflow_dispatch:
    inputs:
      dry-run:
        description: Run the workflow without creating a pull request
        required: false
        default: false
        type: boolean
  schedule:
    - cron: "0 0 * * *"

jobs:
  update:
    runs-on: ubuntu-latest
    timeout-minutes: 10
    permissions:
      contents: write
      pull-requests: write
    if: github.repository_owner == 'luxass'
    steps:
      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
        with:
          persist-credentials: false

      - name: turn yaml to json (old)
        id: old-languages-json
        uses: mikefarah/yq@v4.45.1
        with:
          cmd: yq -p yaml -o json languages.yml > languages-old.json

      - name: old github languages
        uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
        id: old-github-languages
        with:
          script: |
            const { generateOldLanguages } = await import('${{ github.workspace }}/.github/scripts/update-languages.mjs')
            await generateOldLanguages({ github, context })

      - name: download github languages
        run: |
          curl -sSL https://raw.githubusercontent.com/github/linguist/master/lib/linguist/languages.yml -o languages.yml

      - name: turn yaml to json
        id: languages-json
        uses: mikefarah/yq@v4.45.1
        with:
          cmd: yq -p yaml -o json languages.yml > languages.json

      - name: build
        run: cargo build

      - name: generate diff
        id: generate-diff
        uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
        with:
          script: |
            const { generateDiff } = await import('${{ github.workspace }}/.github/scripts/update-languages.mjs')
            await generateDiff({ github, context, core })

      - name: create pull request
        uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # v7.0.6
        if: ${{ github.event.inputs.dry-run != 'true' }}
        with:
          commit-message: "feat: updated github languages"
          title: "feat: updated github languages"
          body: |
            I found some new changes in GitHub's Linguist Repository.

            I don't know what they changed, but I'm sure it's important.
            If you want you can go take a look yourself.

            ${{ steps.generate-diff.outputs.result-new-languages }}
            ${{ steps.generate-diff.outputs.result-removed-languages }}

            I will be waiting for your approval 👋.

            This is an automated PR to update GitHub Languages.
          branch: update-github-languages
          add-paths: languages.yml,src/generated.rs
          base: main
          committer: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
          author: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
          reviewers: luxass