Skip to content

Instantly share code, notes, and snippets.

@AltiusRupert
Forked from sjurgis/apex-prettier.yml
Created May 21, 2021 06:43
Show Gist options
  • Save AltiusRupert/a6283477c577699c9b8ac546e774f245 to your computer and use it in GitHub Desktop.
Save AltiusRupert/a6283477c577699c9b8ac546e774f245 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/[email protected]
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