Skip to content

Update GitHub Actions workflow to use 'master' branch for code format… #5

Update GitHub Actions workflow to use 'master' branch for code format…

Update GitHub Actions workflow to use 'master' branch for code format… #5

Workflow file for this run

name: Format Code
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
format:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup bun
uses: oven-sh/setup-bun@v2
- name: Install dependencies
run: bun install
- name: Format code
run: bun format
- name: Commit changes if any
run: |
git config --global user.name 'github-actions'
git config --global user.email 'github-actions@github.com'
if [[ `git status --porcelain` ]]; then
git add .
git commit -m "Formatted code with Prettier"
git push
fi