{"id":16461576,"url":"https://github.com/stringbean/scalafmt-action","last_synced_at":"2026-05-09T23:51:04.514Z","repository":{"id":44996496,"uuid":"339406775","full_name":"stringbean/scalafmt-action","owner":"stringbean","description":null,"archived":false,"fork":false,"pushed_at":"2023-02-20T13:16:07.000Z","size":1356,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-12T11:08:39.782Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stringbean.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-16T13:26:38.000Z","updated_at":"2022-05-25T17:25:49.000Z","dependencies_parsed_at":"2024-11-11T17:44:33.230Z","dependency_job_id":"3adfc0a0-4839-4c49-98ae-9b21a8ddb744","html_url":"https://github.com/stringbean/scalafmt-action","commit_stats":{"total_commits":16,"total_committers":1,"mean_commits":16.0,"dds":0.0,"last_synced_commit":"ad9d3a004a48f8d6407f2b702732b9490496eddc"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stringbean%2Fscalafmt-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stringbean%2Fscalafmt-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stringbean%2Fscalafmt-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stringbean%2Fscalafmt-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stringbean","download_url":"https://codeload.github.com/stringbean/scalafmt-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240988686,"owners_count":19889547,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T11:08:43.039Z","updated_at":"2026-05-09T23:50:59.470Z","avatar_url":"https://github.com/stringbean.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# scalafmt GitHub Action\n\nGitHub Action for checking Scala source files are correctly formatted using\n[scalafmt](https://scalameta.org/scalafmt/).\n\n## Usage\n\nAdd a job that calls the action:\n\n```yaml\njobs:\n  lint:\n    steps:\n      - uses: stringbean/scalafmt-action@v3\n        with:\n          compare-branch: main\n```\n\nAny scalafmt errors will then get annotated in the action results.\n\n### Minimising git fetch\n\nYou can reduce the amount of git history that is fetched by manually fetching the head and base refs:\n\n```yaml\njobs:\n  lint:\n    name: Scalafmt\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v3\n\n      - name: Checkout branches\n        run: |\n          git remote set-branches origin \"${{github.base_ref}}\" \"${{github.head_ref}}\"\n          git fetch --depth 1\n          git checkout \"${{github.head_ref}}\"\n\n      - uses: stringbean/scalafmt-action@v3\n        with:\n          use-gitignore: true\n          compare-branch: 'origin/${{github.base_ref}}'\n```\n\n\u003e **Note**\n\u003e You _must_ include `origin/` in the `compare-branch` if you are performing a partial fetch otherwise\n\u003e scalafmt will not find the branch.\n\n## Options\n\n| Name             | Description                                                                                    | Default             |\n| ---------------- | ---------------------------------------------------------------------------------------------- | ------------------- |\n| `version`        | Version of scalafmt to run with - if `auto` then the version in `.scalafmt.conf` will be used. | `auto`              |\n| `format-files`   | If `true` then the code will be reformatted instead of checked.                                | `false`             |\n| `compare-branch` | Name of a branch to compare differences to. If set then only changed files will be scanned.    | _none_              |\n| `use-gitignore`  | Whether scalafmt should read the `.gitignore` file (only supported for scalafmt 2.x).          | `true`              |\n| `path`           | Path to Scala sources to scan.                                                                 | `.` (repo root dir) |\n| `github-token`   | GitHub access token to fetch changed files using.                                              | (autodetected)      |\n\n\u003e **Warning**\n\u003e This action uses the native version of scalafmt which cannot switch versions at runtime. The\n\u003e version specified in the action _must_ match the one in `.scalafmt.conf` or the action will fail.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstringbean%2Fscalafmt-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstringbean%2Fscalafmt-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstringbean%2Fscalafmt-action/lists"}