This commit adds a new job to call the readme workflow within the main catppuccin/catppuccin repository. This will make sure that any additions to userstyles will be synced with the README on the main repository.
64 lines
1.8 KiB
YAML
64 lines
1.8 KiB
YAML
name: File Generator
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
paths:
|
|
- "src/**/*"
|
|
|
|
env:
|
|
DENO_DIR: deno_cache
|
|
HAS_USERSTYLES_TOKEN: ${{ secrets.USERSTYLES_TOKEN != '' }}
|
|
|
|
jobs:
|
|
generate-health-files:
|
|
runs-on: ubuntu-latest
|
|
name: Generate Health Files
|
|
permissions:
|
|
# Give the default GITHUB_TOKEN write permission to commit and push the
|
|
# added or changed files to the repository.
|
|
contents: write
|
|
|
|
steps:
|
|
- name: Check Out Repository
|
|
uses: actions/checkout@v3
|
|
if: env.HAS_USERSTYLES_TOKEN
|
|
with:
|
|
token: ${{ secrets.USERSTYLES_TOKEN }}
|
|
ref: ${{ github.ref }}
|
|
|
|
- name: Check Out Repository (Fork)
|
|
uses: actions/checkout@v3
|
|
if: env.HAS_USERSTYLES_TOKEN == 'false'
|
|
with:
|
|
ref: ${{ github.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('src/generate/deno.lock') }}
|
|
path: ${{ env.DENO_DIR }}
|
|
|
|
- name: Update Health Files
|
|
working-directory: src/generate
|
|
run: ./generate.ts
|
|
|
|
- name: Push Changes
|
|
uses: stefanzweifel/git-auto-commit-action@v4
|
|
if: ${{ github.repository == 'catppuccin/userstyles' && github.ref == 'refs/heads/main' && env.HAS_USERSTYLES_TOKEN }}
|
|
with:
|
|
commit_message: "chore: generate health files"
|
|
commit_author: "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>"
|
|
branch: ${{ github.ref }}
|
|
|
|
call-generate-readme-in-catppuccin:
|
|
needs: "generate-health-files"
|
|
uses: catppuccin/catppuccin/.github/workflows/readme.yml@main
|
|
|
|
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
|