Skip to content

Commit 3feeb07

Browse files
authored
ci: consolidate format & generate workflows (catppuccin#485)
1 parent 2fbc661 commit 3feeb07

2 files changed

Lines changed: 22 additions & 40 deletions

File tree

.github/workflows/format.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.
Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
name: File Generator
1+
name: Generate Health Files & Format
22

33
on:
44
workflow_dispatch:
55
push:
6-
paths:
7-
- "scripts/**/*"
6+
branches: [main]
87

98
env:
109
HAS_USERSTYLES_TOKEN: ${{ secrets.USERSTYLES_TOKEN != '' }}
1110

1211
jobs:
13-
generate-health-files:
14-
name: Generate health files
12+
generate-health-files-and-format:
13+
name: Generate health files & format
1514
runs-on: ubuntu-latest
1615
permissions:
1716
# Give the default GITHUB_TOKEN write permission to commit and push the
@@ -37,10 +36,23 @@ jobs:
3736
- name: Generate health files
3837
run: deno task ci:generate
3938

39+
- name: Commit changes
40+
uses: EndBug/add-and-commit@v9
41+
with:
42+
message: "chore: generate health files"
43+
default_author: github_actions
44+
push: false
45+
46+
- name: Format files
47+
run: npx prettier --write .
48+
49+
- name: Commit changes
50+
uses: EndBug/add-and-commit@v9
51+
with:
52+
message: "style: format code with prettier"
53+
default_author: github_actions
54+
push: false
55+
4056
- name: Push changes
41-
uses: stefanzweifel/git-auto-commit-action@v5
4257
if: ${{ github.repository == 'catppuccin/userstyles' && github.ref == 'refs/heads/main' && env.HAS_USERSTYLES_TOKEN }}
43-
with:
44-
commit_message: "chore: generate health files"
45-
commit_author: "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>"
46-
branch: ${{ github.ref }}
58+
run: git push origin "HEAD:${{ github.ref }}" --atomic

0 commit comments

Comments
 (0)