Merge branch 'main' of https://github.com/mid0aria/owofarmbot_stable #55
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |