catppuccin/.github/workflows
Hamothy 4a4a7372d5
ci: add on_workflow_call & on_workflow_dispatch (#2163)
This commit allows the readme.yml to be called by
other workflows and manually invoked.
2023-09-13 23:18:58 +01:00
..
readme.yml ci: add on_workflow_call & on_workflow_dispatch (#2163) 2023-09-13 23:18:58 +01:00

name: Generate READMEs

on:
  workflow_call:
  workflow_dispatch:
  push:
    paths:
      - "resources/**"
  pull_request:
    paths:
      - "resources/**"

env:
  DENO_DIR: deno_cache

jobs:
  readme:
    runs-on: ubuntu-latest
    name: Re-generate README sections

    steps:
      - uses: actions/checkout@v3
        with:
          ref: ${{ github.head_ref }}
      - name: Set up Deno
        uses: denoland/setup-deno@v1
        with:
          deno-version: v1.x
      - name: Cache Deno dependencies
        uses: actions/cache@v3
        with:
          key: ${{ hashFiles('resources/generate/deno.lock') }}
          path: ${{ env.DENO_DIR }}
      - name: Update READMEs
        working-directory: resources/generate
        run: ./main.ts
      - name: Push changes
        uses: stefanzweifel/git-auto-commit-action@v4
        # only push once upstreamed
        if: ${{ github.repository == 'catppuccin/catppuccin' && github.ref == 'refs/heads/main' }}
        with:
          commit_message: "chore: re-generate README sections"
          branch: ${{ github.head_ref }}
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json