Skip to content

Commit

Permalink
try format action
Browse files Browse the repository at this point in the history
  • Loading branch information
trueberryless committed Nov 25, 2024
1 parent 850c41a commit 3f369da
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 2 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/format.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Format

on:
push:
branches: [main]

jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
run_install: |
- recursive: false
args: [--frozen-lockfile]
- args: [prettier]
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
- run: pnpm i
- name: Format with Prettier
run: pnpm prettier --write .
- uses: gr2m/create-or-update-pull-request-action@v1
env:
GITHUB_TOKEN: ${{ secrets.PUBLIC_GITHUB_TOKEN }}
with:
title: "[ci] format"
body: "This PR was automatically created to format the repository using prettier."
branch: "ci/format"
commit-message: "[ci] format"
author: "trueberryless <[email protected]> (https://trueberryless.org)"
labels: 🤖 bot
assignees: trueberryless
reviewers: trueberryless
37 changes: 37 additions & 0 deletions template-files/.github/workflows/format.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Format

on:
push:
branches: [<%= branchName %>]

jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
run_install: |
- recursive: false
args: [--frozen-lockfile]
- args: [prettier]
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
- run: pnpm i
- name: Format with Prettier
run: pnpm prettier --write .
- uses: gr2m/create-or-update-pull-request-action@v1
env:
GITHUB_TOKEN: ${{ secrets.PUBLIC_GITHUB_TOKEN }}
with:
title: "[ci] format"
body: "This PR was automatically created to format the repository using prettier."
branch: "ci/format"
commit-message: "[ci] format"
author: "trueberryless <[email protected]> (https://trueberryless.org)"
labels: 🤖 bot
assignees: trueberryless
reviewers: trueberryless
4 changes: 2 additions & 2 deletions template-files/.github/workflows/sort.package.json.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Sort Package.json Files

on:
schedule:
- cron: "0 0 * * 3"
push:
branches: [<%= branchName %>]
workflow_dispatch:

jobs:
Expand Down

0 comments on commit 3f369da

Please sign in to comment.