-
-
Notifications
You must be signed in to change notification settings - Fork 148
53 lines (45 loc) · 1.48 KB
/
generate.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: File Generator
on:
workflow_dispatch:
push:
paths:
- "scripts/**/*"
env:
DENO_DIR: /tmp/deno_cache
HAS_USERSTYLES_TOKEN: ${{ secrets.USERSTYLES_TOKEN != '' }}
jobs:
generate-health-files:
name: Generate health files
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- uses: actions/checkout@v4
if: env.HAS_USERSTYLES_TOKEN
with:
token: ${{ secrets.USERSTYLES_TOKEN }}
ref: ${{ github.ref }}
- uses: actions/checkout@v4
if: env.HAS_USERSTYLES_TOKEN == 'false'
with:
ref: ${{ github.ref }}
- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- name: Cache Deno dependencies
uses: actions/cache@v3
with:
key: ${{ hashFiles('./deno.lock') }}
path: ${{ env.DENO_DIR }}
- name: Generate health files
run: deno task ci:generate
- name: Push changes
uses: stefanzweifel/git-auto-commit-action@v5
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 }}