Skip to content

why, let me do all in one commit plz #46

why, let me do all in one commit plz

why, let me do all in one commit plz #46

Workflow file for this run

name: Format
on:
push:
branches: [main]
permissions:
contents: write
jobs:
format:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GH_PAT }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22.x"
- name: Install dependencies
run: npm i
- name: Run Prettier
run: npm run format
- name: Commit & Push Changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add -A
git commit -m "Apply formatting changes" || echo "No changes to commit"
BRANCH_NAME=${{ github.head_ref || github.ref_name }}
echo "Pushing to branch: $BRANCH_NAME"
git push https://x-access-token:${{ secrets.GH_PAT }}@github.com/${{ github.repository }}.git HEAD:$BRANCH_NAME