Skip to content

Commit

Permalink
update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
MFM-347 committed Jan 1, 2025
1 parent 6a90ba3 commit 2ce02bf
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/debug.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Build debug-app
'on':
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
Expand Down
65 changes: 65 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: AutoFormat

on:
push:
paths:
- '**/*'
branches:
- main
pull_request:
paths:
- '**/*'
branches:
- main
workflow_dispatch:

jobs:
format:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16'

- name: Configure Prettier
run: |
echo '{
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5",
"printWidth": 80,
"arrowParens": "always"
}' > .prettierrc
echo '*.min.*
.github/**/*
*-min.*
*.xml' > .prettierignore
- name: Install Prettier with plugins
run: |
npm i -D prettier prettier-plugin-java
- name: Format all files
run: |
npx prettier -w **/*.md
npx prettier -w **/*.java --plugin=prettier-plugin-java
- name: Clean up unnecessary files
run: |
rm -rf node_modules
rm -f package.json
rm -f package-lock.json
rm -f .prettierrc
rm -f .prettierignore
- name: Commit changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "actions@github.com"

0 comments on commit 2ce02bf

Please sign in to comment.