{"id":17866192,"url":"https://github.com/xt0rted/dotnet-format","last_synced_at":"2025-04-09T23:19:00.166Z","repository":{"id":36977961,"uuid":"203107525","full_name":"xt0rted/dotnet-format","owner":"xt0rted","description":"A GitHub Action to run dotnet-format as part of your workflow","archived":false,"fork":false,"pushed_at":"2025-04-07T00:38:33.000Z","size":1064,"stargazers_count":32,"open_issues_count":17,"forks_count":26,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-09T23:18:58.287Z","etag":null,"topics":["dotnet","dotnet-core","dotnet-format","dotnet-tool","github-actions","linting"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xt0rted.png","metadata":{"funding":{"github":"xt0rted","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null},"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2019-08-19T05:57:38.000Z","updated_at":"2025-03-24T00:51:12.000Z","dependencies_parsed_at":"2024-01-15T01:39:37.551Z","dependency_job_id":"6c062f99-2c86-455e-99bf-b2c68f415ec9","html_url":"https://github.com/xt0rted/dotnet-format","commit_stats":{"total_commits":504,"total_committers":3,"mean_commits":168.0,"dds":0.3849206349206349,"last_synced_commit":"60d2db93174ffaadc5f7a91190043fcfdbd9cb57"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xt0rted%2Fdotnet-format","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xt0rted%2Fdotnet-format/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xt0rted%2Fdotnet-format/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xt0rted%2Fdotnet-format/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xt0rted","download_url":"https://codeload.github.com/xt0rted/dotnet-format/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248125644,"owners_count":21051777,"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":["dotnet","dotnet-core","dotnet-format","dotnet-tool","github-actions","linting"],"created_at":"2024-10-28T09:28:55.748Z","updated_at":"2025-04-09T23:19:00.140Z","avatar_url":"https://github.com/xt0rted.png","language":"TypeScript","funding_links":["https://github.com/sponsors/xt0rted"],"categories":[],"sub_categories":[],"readme":"# GitHub Action for dotnet-format\n\n[![CI](https://github.com/xt0rted/dotnet-format/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/xt0rted/dotnet-format/actions/workflows/ci.yml)\n[![CodeQL](https://github.com/xt0rted/dotnet-formatc/actions/workflows/codeql-analysis.yml/badge.svg?branch=main)](https://github.com/xt0rted/dotnet-format/actions/workflows/codeql-analysis.yml)\n\nRun [dotnet-format](https://github.com/dotnet/format) v3 as part of your workflow to report formatting errors or auto fix violations as part of your pull request workflow.\n\n## Usage\n\nRunning on `push`.\n\n```yml\nname: Format check on push\non: push\njobs:\n  dotnet-format:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout repo\n        uses: actions/checkout@v2\n\n      - name: Add dotnet-format problem matcher\n        uses: xt0rted/dotnet-format-problem-matcher@v1\n\n      - name: Restore dotnet tools\n        uses: xt0rted/dotnet-tool-restore@v1\n\n      - name: Run dotnet format\n        uses: xt0rted/dotnet-format@v1\n```\n\nRunning on `pull_request`.\n\n```yml\nname: Format check on pull request\non: pull_request\njobs:\n  dotnet-format:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout repo\n        uses: actions/checkout@v2\n\n      - name: Add dotnet-format problem matcher\n        uses: xt0rted/dotnet-format-problem-matcher@v1\n\n      - name: Restore dotnet tools\n        uses: xt0rted/dotnet-tool-restore@v1\n\n      - name: Run dotnet format\n        uses: xt0rted/dotnet-format@v1\n        with:\n          only-changed-files: \"true\"\n```\n\nRunning on demand by pull request comment, triggered by the text `/dotnet format`.\n\n\u003e ℹ The provided `GITHUB_TOKEN` will not trigger additional workflows.\n\u003e To push fixes back to the pull request branch you'll need to [setup a secret](https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets) with a [Personal Access Token](https://github.com/settings/tokens/new?scopes=repo\u0026description=github%20actions) that has the `repo` scope.\n\n```yml\nname: Format on slash command\non:\n  issue_comment:\n    types: created\njobs:\n  dotnet-format:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Check for command\n        id: command\n        uses: xt0rted/slash-command-action@v1\n        continue-on-error: true\n        with:\n          command: dotnet\n          reaction-type: \"eyes\"\n\n      - name: Get branch info\n        if: steps.command.outputs.command-name\n        id: comment-branch\n        uses: xt0rted/pull-request-comment-branch@v1\n        with:\n          repo_token: ${{ secrets.GITHUB_TOKEN }}\n\n      - name: Checkout repo\n        if: steps.command.outputs.command-name\n        uses: actions/checkout@v2\n        with:\n          ref: ${{ steps.comment-branch.outputs.ref }}\n          persist-credentials: false\n\n      - name: Restore dotnet tools\n        if: steps.command.outputs.command-name\n        uses: xt0rted/dotnet-tool-restore@v1\n\n      - name: Run dotnet format\n        if: steps.command.outputs.command-name \u0026\u0026 steps.command.outputs.command-arguments == 'format'\n        id: format\n        uses: xt0rted/dotnet-format@v1\n        with:\n          action: \"fix\"\n          only-changed-files: true\n\n      - name: Commit files\n        if: steps.command.outputs.command-name \u0026\u0026 steps.command.outputs.command-arguments == 'format' \u0026\u0026 steps.format.outputs.has-changes == 'true'\n        run: |\n          git config --local user.name \"github-actions[bot]\"\n          git config --local user.email \"41898282+github-actions[bot]@users.noreply.github.com\"\n          git commit -a -m 'Automated dotnet-format update\n\n          Co-authored-by: ${{ github.event.comment.user.login }} \u003c${{ github.event.comment.user.id }}+${{ github.event.comment.user.login }}@users.noreply.github.com\u003e'\n\n      - name: Push changes\n        if: steps.command.outputs.command-name \u0026\u0026 steps.command.outputs.command-arguments == 'format' \u0026\u0026 steps.format.outputs.has-changes == 'true'\n        uses: ad-m/github-push-action@v0.5.0\n        with:\n          branch: ${{ steps.comment-branch.outputs.ref }}\n          github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}\n```\n\n## Token Permissions\n\nIf your repository is using [token permissions](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#permissions), and you want to check only changed files, you'll need to set `pull-request: read` on either the workflow or the job.\n\n### Workflow Config\n\n```yml\non: pull_request\npermissions:\n  pull-requests: read\njobs:\n  dotnet-format:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Run dotnet format\n        uses: xt0rted/dotnet-format@v1\n        with:\n          only-changed-files: \"true\"\n```\n\n### Job Config\n\n```yml\non: pull_request\njobs:\n  dotnet-format:\n    runs-on: ubuntu-latest\n    permissions:\n      pull-requests: read\n    steps:\n      - name: Run dotnet format\n        uses: xt0rted/dotnet-format@v1\n        with:\n          only-changed-files: \"true\"\n```\n\n## Options\n\n### Required\n\nName | Allowed values | Description\n-- | -- | --\n`repo-token` | `GITHUB_TOKEN` (default) or PAT | `GITHUB_TOKEN` token or a repo scoped PAT.\n`version` | `3` (default) | Version of `dotnet-format` to use.\n`action` | `check` (default), `fix` | Primary action `dotnet-format` should perform.\n\n### Optional\n\nName | Allowed values | Description\n-- | -- | --\n`only-changed-files` | `true`, `false` (default) | Only changed files in the current pull request should be formatted.\n`fail-fast` | `true` (default), `false` | The job should fail if there's a formatting error. Only used with the `check` action.\n\n## Outputs\n\nName | Description\n-- | --\n`has-changes` | If any files were found to have violations or had fixes applied. Will be a string value of `true` or `false`.\n\n## License\n\nThe scripts and documentation in this project are released under the [MIT License](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxt0rted%2Fdotnet-format","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxt0rted%2Fdotnet-format","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxt0rted%2Fdotnet-format/lists"}