Prettier Fix #41
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@v4 | |
with: | |
node-version: "18.20.4" | |
- name: Install dependencies | |
run: npm i [email protected] --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 '[email protected]' | |
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 }} |