Repository navigation
For open-java-format 2.98.0.2 and later.
The version to check with goes in .open-java-format-version at the repository root:
2.98.0.6
- uses: actions/checkout@v7
- uses: openjavaformat/open-java-format-action@v4
with:
mode: ${{ github.event_name == 'push' && 'all' || 'changed' }}What changed since v3
- The
versioninput is gone. The action and the pre-commit hook both read.open-java-format-versionfrom the repository root, so the two cannot drift apart. Without the file, or with something in it that is not a version number, both stop and say what to put there. - The hook no longer pins
FORMATTER_VERSIONat its top. A repository that copied the v3 hook takes the v4 one. - The log warning and the code scanning alert for a newer open-java-format release now point at
.open-java-format-version, line 1.
To move from v3: put the version the workflow passed as version in .open-java-format-version, drop the input, and switch to @v4.
A workflow that pins open-java-format 2.98.0.1 should stay on @v1: that version needs --ojf, which v2 and later do not pass.