Skip to content

Instantly share code, notes, and snippets.

@sjurgis
Last active May 21, 2021 06:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sjurgis/701ea16c08abf7fa743a6162539d94e9 to your computer and use it in GitHub Desktop.
Save sjurgis/701ea16c08abf7fa743a6162539d94e9 to your computer and use it in GitHub Desktop.
apex-prettier Github Action
name: apex pretify
on:
push:
paths:
- 'myns/main/core/classes/**'
- 'myns/main/default/classes/**'
- 'myns/main/services/classes/**'
- 'myns/main/services/classes/tests/**'
- 'myns/tests/classes/**'
jobs:
pretify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: bahmutov/npm-install@v1
with:
useLockFile: true
- run: npm run apex-prettier
- uses: stefanzweifel/git-auto-commit-action@v4.1.6
with:
commit_message: Apply apex-prettier changes
BEGIN PACKAGE.JSON FILE
{
"scripts": {
"apex-prettier": "start-apex-server & npx wait-on http://localhost:2117/api/ast/ && prettier --write 'myns/**/*.{trigger,cls}' --tab-width 4 --print-width 100 --apex-standalone-parser built-in && stop-apex-server"
},
"devDependencies": {
"prettier": "^2.0.5",
"prettier-plugin-apex": "^1.3.0",
"wait-on": "^5.0.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment