Update prettier.yml

This commit is contained in:
William Harrison authored and GitHub committed 2024-11-10 20:41:36 +08:00
1 parent 1760d7f82e
commit 040cd6f5bc
1 file changed
+10 -5
+10 -5
View File
@@ -22,25 +22,30 @@ jobs:
- name: Run Prettier - name: Run Prettier
run: npx -y prettier ./domains -w --tab-width 2 --print-width 120 run: npx -y prettier ./domains -w --tab-width 2 --print-width 120
- name: Create and switch to new branch - name: Create branch
run: | run: |
BRANCH_NAME="prettier-$(date +%s)" BRANCH_NAME="prettier-$(date +%s)"
echo "Generated branch name: $BRANCH_NAME"
if [ -z "$BRANCH_NAME" ]; then
echo "Error: Branch name is empty."
exit 1
fi
git checkout -b "$BRANCH_NAME" git checkout -b "$BRANCH_NAME"
- name: Commit changes - name: Commit
run: | run: |
git config --local user.email "bot@is-a.dev" git config --local user.email "bot@is-a.dev"
git config --local user.name "is-a-dev-bot" git config --local user.name "is-a-dev-bot"
git add . git add .
git commit -m "chore: apply Prettier formatting" git commit -m "chore: apply formatting"
- name: Push changes to new branch - name: Push
env: env:
API_TOKEN_GITHUB: ${{ secrets.BOT }} API_TOKEN_GITHUB: ${{ secrets.BOT }}
run: | run: |
git push -u origin "$BRANCH_NAME" git push -u origin "$BRANCH_NAME"
- name: Create Pull Request - name: Create pull request
id: create_pr id: create_pr
uses: peter-evans/create-pull-request@v5 uses: peter-evans/create-pull-request@v5
with: with: