{"id":14985900,"url":"https://github.com/restyled-io/actions","last_synced_at":"2026-04-22T04:03:15.259Z","repository":{"id":250008150,"uuid":"833210650","full_name":"restyled-io/actions","owner":"restyled-io","description":"Actions for installing and running Restyled","archived":false,"fork":false,"pushed_at":"2026-04-16T02:52:24.000Z","size":3064,"stargazers_count":8,"open_issues_count":1,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-16T04:34:31.959Z","etag":null,"topics":["actions"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/restyled-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-07-24T15:13:38.000Z","updated_at":"2026-04-16T02:50:58.000Z","dependencies_parsed_at":"2024-12-12T02:28:04.375Z","dependency_job_id":"bca54fb8-5aec-4326-aab6-f40ba8a23395","html_url":"https://github.com/restyled-io/actions","commit_stats":{"total_commits":87,"total_committers":4,"mean_commits":21.75,"dds":0.05747126436781613,"last_synced_commit":"d218a0ff3f21eb9260a251df392398e033589993"},"previous_names":["restyled-io/actions"],"tags_count":59,"template":false,"template_full_name":null,"purl":"pkg:github/restyled-io/actions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/restyled-io%2Factions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/restyled-io%2Factions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/restyled-io%2Factions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/restyled-io%2Factions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/restyled-io","download_url":"https://codeload.github.com/restyled-io/actions/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/restyled-io%2Factions/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32120402,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-22T00:31:26.853Z","status":"online","status_checked_at":"2026-04-22T02:00:05.693Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["actions"],"created_at":"2024-09-24T14:11:51.212Z","updated_at":"2026-04-22T04:03:15.223Z","avatar_url":"https://github.com/restyled-io.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# Restyled Actions\n\n## Usage Examples\n\nThe [`restyle` CLI][restyler] is meant to one thing and do it well: re-format\nfiles according to configuration and commit any changes. The actions in this\nrepository are for installing the CLI, running it, and exposing its results such\nthat other, non-restyled actions can be used to do useful things. Below are\nexample workflows for doing such things.\n\n[restyler]: https://github.com/restyled-io/restyler#readme\n\nIn all cases, we recommend creating the workflow as `restyled.yml`, naming it\n`Restyled`, and using `concurrency` to cancel redundant jobs:\n\n```yaml\n# .github/workflows/restyled.yml\n\nname: Restyled\n\non:\n  pull_request:\n\nconcurrency:\n  group: ${{ github.workflow }}-${{ github.ref }}\n  cancel-in-progress: true\n```\n\nThe workflows described here are meant to be combined and extended.\n\n### Status Check\n\n**Good for**: users who want CI to fail on style issues.\n\n![](./files/failing-status.png)\n\n```yaml\njobs:\n  restyled:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      - uses: restyled-io/actions/setup@v4\n      - uses: restyled-io/actions/run@v4\n        with:\n          fail-on-differences: true\n```\n\n\u003e [!NOTE]\n\u003e If combining `fail-on-differences` with other examples below, make sure you\n\u003e update the conditions on later steps that should run when differences are\n\u003e found (but not if restyler errors):\n\u003e\n\u003e ```yaml\n\u003e if: ${{ !cancelled \u0026\u0026 steps.restyler.outputs.success == 'true' }}\n\u003e ```\n\n### Code Suggestion Comments\n\n**Good for**: PRs (including forks) with a low number of style issues, probably\nbecause the team size is small and everyone has an effective local editor setup.\n\n![](./files/suggestion.png)\n\n```yaml\njobs:\n  restyled:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      - uses: restyled-io/actions/setup@v4\n      - uses: restyled-io/actions/run@v4\n        with:\n          suggestions: true\n```\n\nSee also: `inputs.suggestions-limit`, `outputs.suggestions-skipped`.\n\n### Upload Patch Artifact\n\n**Good for**: users who are not using _Code Suggestion Comments_ and expect\ncontributions in forks (where _Sibling PRs_ cannot be used).\n\n![](./files/patch-artifact.png)\n\n```yaml\njobs:\n  restyled:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      - uses: restyled-io/actions/setup@v4\n\n      - id: restyler\n        uses: restyled-io/actions/run@v4\n\n      - if: ${{ steps.restyler.outputs.git-patch }}\n        run: |\n          cat \u003e\u003e/tmp/restyled.diff \u003c\u003c'EOM'\n          ${{ steps.restyler.outputs.git-patch }}\n          EOM\n\n      - id: upload\n        uses: actions/upload-artifact@v4\n        with:\n          path: /tmp/restyled.diff\n          if-no-files-found: ignore\n          overwrite: true\n\n      - if: ${{ steps.upload.outputs.artifact-url }}\n        run: |\n          cat \u003e\u003e\"$GITHUB_STEP_SUMMARY\" \u003c\u003c'EOM'\n          ## Restyled\n\n          To apply these fixes locally,\n\n          1. Download [this patch artifact](${{ steps.upload.outputs.artifact-url }})\n          2. Unzip it: `unzip artifact.zip`\n          3. Apply it: `git am \u003c restyled.diff`\n\n          EOM\n```\n\n### Sibling PRs\n\n**Good for**: non-fork PRs with a high number of style issues, so merging them\nall as a single Sibling PR is better than triaging _Code Suggestion Comments_.\n\n![](./files/pull-request-event.png)\n\n![](./files/pull-request.png)\n\n```yaml\njobs:\n  restyled:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n        with:\n          ref: ${{ github.event.pull_request.head.ref }}\n\n      - uses: restyled-io/actions/setup@v4\n\n      - id: restyler\n        uses: restyled-io/actions/run@v4\n\n      - uses: peter-evans/create-pull-request@v7\n        with:\n          base: ${{ steps.restyler.outputs.restyled-base }}\n          branch: ${{ steps.restyler.outputs.restyled-head }}\n          title: ${{ steps.restyler.outputs.restyled-title }}\n          body: ${{ steps.restyler.outputs.restyled-body }}\n          labels: \"restyled\"\n          reviewers: ${{ github.event.pull_request.user.login }}\n          delete-branch: true\n```\n\n#### Handling Forks\n\nIf you expect PRs from forks, sibling PRs are not possible. You should skip\nthem:\n\n```diff\n jobs:\n   restyled:\n+    if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}\n     runs-on: ubuntu-latest\n```\n\nOptionally, add a separate job for forks that does something else:\n\n```yaml\n  restyled-fork:\n    if: ${{ github.event.pull_request.head.repo.full_name != github.repository }}\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      - uses: restyled-io/actions/setup@v4\n      - uses: restyled-io/actions/run@v4\n        with:\n          fail-on-differences: true\n```\n\n#### Cleaning Up\n\nIf you elect not to merge a sibling PR, it will remain open. One option for\ncleaning up is to run this workflow on closed events:\n\n```diff\n on:\n   pull_request:\n+    types:\n+      - opened\n+      - reopened\n+      - synchronize\n+      - closed\n```\n\nEnsure you don't run the usual jobs for that action:\n\n```diff\n jobs:\n   restyled:\n-    if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}\n+    if: |\n+      github.event.action != 'closed' \u0026\u0026\n+      github.event.pull_request.head.repo.full_name == github.repository\n\n    runs-on: ubuntu-latest\n```\n\n```diff\n   restyled-fork:\n-    if: ${{ github.event.pull_request.head.repo.full_name != github.repository }}\n+    if: |\n+      github.event.action != 'closed' \u0026\u0026\n+      github.event.pull_request.head.repo.full_name != github.repository\n\n     runs-on: ubuntu-latest\n```\n\nAnd run a clean-up job instead:\n\n```yaml\n  restyled-cleanup:\n    if: ${{ github.event.action == 'closed' }}\n    runs-on: ubuntu-latest\n    steps:\n      - uses: restyled-io/actions/setup@v4\n      - id: restyler\n        uses: restyled-io/actions/run@v4\n      - run: gh pr close \"$BRANCH\" --delete-branch || true\n        env:\n          BRANCH: ${{ steps.restyler.outputs.restyled-head }}\n          GH_TOKEN: ${{ github.token }}\n```\n\n## Workflow Permissions\n\nThe specific permissions required depends on your workflow:\n\n1. `restyled-io/actions/setup` requires no permissions\n1. `restyled-io/actions/run` requires no permission by default, but requires\n   `pull-requests:write` if leaving suggestion comments\n1. For `actions/checkout`, see its [docs][checkout-docs]\n1. For `peter-evans/create-pull-request`, see its [docs][createpr-docs]\n\n[checkout-docs]: https://github.com/actions/checkout?tab=readme-ov-file#recommended-permissions\n[createpr-docs]: https://github.com/peter-evans/create-pull-request?tab=readme-ov-file#workflow-permissions\n\nDefault permissions for workflows can be adjusted in your repository settings,\nor a `permissions` key can be used in the workflow itself. For more details, see\nthe [documentation][permissions-docs].\n\n[permissions-docs]: https://docs.github.com/actions/reference/authentication-in-a-workflow#modifying-the-permissions-for-the-github_token\n\n## License\n\nThis software is licensed AGPLv3. See [COPYING](./COPYING).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frestyled-io%2Factions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frestyled-io%2Factions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frestyled-io%2Factions/lists"}