Prettier Fix #6
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: Prettier Fix | |
on: | |
workflow_dispatch: | |
inputs: | |
reason: | |
description: "Reason for manually triggering this workflow" | |
required: false | |
schedule: | |
- cron: "0 0 * * 0" | |
jobs: | |
prettier-fix: | |
permissions: write-all | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up date environment variables | |
run: | | |
echo "BRANCH_TITLE=pretty-fix-$(date +%s)" >> $GITHUB_ENV | |
echo "PR_TITLE=Prettier Fix - $(date)" >> $GITHUB_ENV | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "18.20.4" | |
- name: Install dependencies | |
run: npm i prettier@2.5.1 --save-dev --save-exact | |
- name: Pretty Check | |
run: npm run pretty-fix | |
- name: Create commits | |
id: commits | |
continue-on-error: true | |
run: | | |
git config user.name 'monkeytypegeorge' | |
git config user.email 'monkeytypegeorge@gmail.com' | |
git add . | |
git commit -m 'refactor: run prettier' | |
- name: Create pull request | |
uses: peter-evans/create-pull-request@v4 | |
with: | |
branch: ${{ env.BRANCH_TITLE }} | |
title: ${{ env.PR_TITLE }} | |
body: ${{ env.PR_TITLE }} |