Skip to content

Merge pull request #12 from korrectional/dependabot/npm_and_yarn/axio… #79

Merge pull request #12 from korrectional/dependabot/npm_and_yarn/axio…

Merge pull request #12 from korrectional/dependabot/npm_and_yarn/axio… #79

Workflow file for this run

name: Prettify Code
on:
push:
pull_request:
jobs:
prettify:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0 # Required for pushing changes
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "18" # Use latest LTS
- name: Install dependencies
run: npm install
- name: Prettify code
run: npx prettier --write .
- name: Commit changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "chore: auto-format code" || echo "No changes to commit"
git push https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git HEAD:${{ github.ref }}