Repository navigation
v3
For open-java-format 2.98.0.2 and later.
- uses: actions/checkout@v7
- uses: openjavaformat/open-java-format-action@v3
with:
version: '2.98.0.6'
mode: ${{ github.event_name == 'push' && 'all' || 'changed' }}What changed since v2
- The check for a newer open-java-format release can go to code scanning as well as the job log. With
code-scanning: trueand thesecurity-events: writepermission, the action uploads a SARIF file: one alert under Security → Code scanning and in the "Code scanning results" check of a pull request while the version is behind, placed on the line of the workflow that names the version, and closed on its own once the version is updated. This is off by default, so a workflow that does not ask for it runs as before. See Code scanning in the README, which shows a recommended setup with the check in the log alone and one with code scanning too. versiondefaults to 2.98.0.6, and so does the hook'sFORMATTER_VERSION.
A workflow that pins open-java-format 2.98.0.1 should stay on @v1: that version needs --ojf, which v2 and v3 do not pass.