我很难正确设置我的GitHub更漂亮的操作。我计划使用creyD/firer_action GitHub操作来格式化传入的提交,但每次代码被审查时,它总是会抛出一个错误。
格式-降级.yml
name: Format Codebase w/ Prettier
run-name: ${{ github.actor }} is attempting to ${{github.event_name}} to ${{github.repository}}
on:
pull_request:
push:
branches:
- main
jobs:
prettier:
runs-on: ubuntu-latest
env:
RUNNER_TOOL_CACHE: /toolcache
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: pnpm/action-setup@v3
with:
version: 8
run_install: false
standalone: true
dest: ~/setup-pnpm
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: ^9
- name: Install dependencies
run: pnpm install
- name: Run Prettier
uses: creyD/[email protected]
with:
prettier_options: --write **/*.{js,ts,jsx,tsx,css} --tab-width 4
prettier_plugins: "prettier-plugin-tailwindcss"
结果:
Run creyD/[email protected]
...
Run PATH=$GITHUB_ACTION_PATH/node_modules/.bin:$PATH /home/runner/work/_actions/creyD/prettier_action/v4.3/entrypoint.sh
...
Installing prettier...
Checking plugin: prettier-plugin-tailwindcss
Prettifying files...
Files:
.prettierrc.js 403ms
app/globals.css 47ms
...
utils/utils.ts 6ms
Prettier result: 0
Deleting node_modules/ folder...
[unnamed 8204e68] Prettified Code!
Author: unnamed-lab <[email protected]>
36 files changed, 1437 insertions(+), 1404 deletions(-)
remote: Permission to unnamed-lab/ai-qr-generator.git denied to github-actions[bot].
fatal: unable to access 'https://github.com/unnamed-lab/ai-qr-generator/': The requested URL returned error: 403
Error: Process completed with exit code 128.